- accepts_nested_attributes and validates_presense_of on association id fails without inverse_of
Having a validation that the association id is present when trying to use nested attributes fails because the child object is validated before the parent object in memory has an id.
However, if you decorate the association with :inverse_of, it tells Rails to look in memory first which both saves memory and allows Rails to build the graph of objects correctly with validation!
- Super Happy Dev House in SF tomorrow
Mother of all hack days. They’re usually down in the valley! http://shdh52.eventbrite.com/