I noticed that you can't cascade an include more than twice on the same association (for has_many at least). It seems that the association name table alias is used as a key to store the number of times that the association has been used in the include. This allows the alias to change for each subsequent join. However, the way that the code was written caused a new key to be used each time the alias count was incremented. As a result, you could not cascade more than twice on an association:

Tree.find(:first, :include => {:children => {:children => :children}})

The attached diff fixes this issue and passes all unit tests.

Rich

Attachment: cascading_associations_fix.diff
Description: Binary data

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to