Displaying 1 result from an estimated 1 matches for "validate_size_of".
Did you mean:
validates_size_of
2006 Aug 15
0
has_many relationships and minimums
Hi,
New to Rails and the list.
Quick questions regarding has_many relationships that require at least 1
child.
I''m aware of validate_size_of and use this to make sure that the parent
is not saved without at least one child. Question is, is there some
Rails magic to help when removing children to ensure the last one is not
removed? Currently I''m calling something like this in my controller:
unless parent.children.size == 1
@p...