I added additional fixes to recursively cascading associations. This patch includes fixes for has_many :through and habtm (with tests) as well as tests for has_one and belongs_to. I created some new models for testing and added the required sql for creating and dropping the tables. This is _only_ tested on postgresql.

As a quick summary, here are some examples that previously would not work and are now tested and/or fixed:

root_node = RecursivelyCascadedTreeMixin.find(:first, :include=> {:first_child=>{:first_child=>:first_child}}, :order => 'mixins.id') leaf_node = RecursivelyCascadedTreeMixin.find(:first, :include=> {:parent=>{:parent=>:parent}}, :order => 'mixins.id DESC') source = Vertex.find(:first, :include=>{:sinks=>{:sinks=> {:sinks=>:sinks}}}, :order => 'vertices.id') sink = Vertex.find(:first, :include=>{:sources=>{:sources=> {:sources=>:sources}}}, :order => 'vertices.id DESC')

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