#8975 [PATCH] with_scope :joins clobber find :joins

I just created this ticket and added a patch to fix the issue + test cases. Could someone please review and apply the patch?

When the :joins option is included in a call to with_scope, the :joins in the find options are ignored. This patch updates the add_joins! method to add the :joins option from the scope and from the find options.

with_scope( :find => { :joins => "left join geocodings on users.id = geocodings.geocodable_id" } ) do   find( :all, :joins => "left join taggings on users.id = taggings.taggable_id" ) end

Currently outputs:

SELECT users.* FROM users left join geocodings on users.id = geocodings.geocodable_id

With this patch, it outputs:

SELECT users.* FROM users left join taggings on users.id = taggings.taggable_id left join geocodings on users.id = geocodings.geocodable_id

I just created this ticket and added a patch to fix the issue + test cases. Could someone please review and apply the patch?

Ask for some reviewers on the #rails-contrib irc channel. It sounds like a bug and if you can get the patch verified, it should probably be applied.

http://wiki.rubyonrails.org/rails/pages/PatchRequirements

I posted my feedback to the ticket.

http://dev.rubyonrails.org/ticket/8975

The few times I've been in #rails-contrib no one is responsive. Is that really better than using rails-core to ask for reviewers? I guess using both is best.

The few times I've been in #rails-contrib no one is responsive. Is that really better than using rails-core to ask for reviewers? I guess using both is best.

Using the mailing list is fine too :).