Displaying 1 result from an estimated 1 matches for "macksmind".
2008 Apr 23
1
Validation dependent on unsaved parent
I''m having trouble with a validation that depends on an attribute of a
belongs_to parent. If the child is added to an unsaved parent
(parent.children << new child), the has_many collection
parent.children includes the unsaved child. However the belongs_to
attribute child.parent appears to be nil until the parent has been
saved. Without access to the parent attributes, the validation