is the easiest way to share online.
Learn more »
Re: Validating Nested Attributes on Update -
November 11, 2011
"You're right, that's exactly what I did, just force it in the controller. To check that the associations are valid all the time, I could, maybe _should_, have used validates_associated :children .. but that still doesn't validate the requirement that I had at the time, namely, that at least one child must be present in order for the Parent to be valid. If I was doing this now, I think I would use a custom validation, check the size of the children association, and add the error if the size was zero." -
©2013 FriendFeed -
Tools & Widgets