Forum: Ruby on Rails validates_associated is unnecessary?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fernando P. (Guest)
on 2009-05-31 00:08

I have a strange problem. Using accepts_nested_attributes_for, if I add
on top of that the validates_associated declaration, AR makes 1 SQL
query based on the parent_id (I use acts_as_list and acts_as_tree) for
each associated child POSTed.

When I remove the validates_associated declaration, the sql queries
disappear and in fact if the associated models are not valid, then the
parent model won't be valid either, as if the validates_associated was
useless for me.

Is there something that I am not getting here? I find it very strange.

Thanks in advance to whoever can shed light on this.
This topic is locked and can not be replied to.