Archive for June, 2010
Learned a lot about nested attributes and Rails
by specialj on Jun.04, 2010, under Ruby On Rails
It’s been a frustrating night trying to figure out how accepts_nested_attributes_for, autosave, dirtyness, and Rails versions all fit together. Going to try and summarize my findings and hopefully I’ll get it right.
- accepts_nested_attributes_for turns on autosave
- autosave will cause any loaded associations to be saved when save for the parent object is called
- the key word is “loaded”, so a find with an include will cause the association to be loaded, and thus autosaved (took my a long time to track this down)
- in Rails 2.3.5 the association is saved regardless of dirty state
- in Rails 2.3.8 the association is saved only if dirty
xAuth as an alternative to OAuth
by specialj on Jun.01, 2010, under Web Development
In doing some work with OAuth today I cam across xAuth which is apparently supported by Twitter. Good thing to be aware of:
Pay attention to the default IO scheduler
by specialj on Jun.01, 2010, under virtualization
With recent versions of Ubuntu running as Xen DomU’s I’ve noticed that the default scheduler is deadline. I’ve read documentation that noop should be the preferred scheduler. However, I make use of ionice, as do disk intensive programs such as fcheck. It’s not often noted but ionice only works with the cfq scheduler and because of that cfq is probably the best default for any system.