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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---