Reputation: 6149
In rails 2 you could use proxy_options
to see the options for specific database queries. In rails 3 it has been removed. Is there a different option for getting this same info?
Upvotes: 3
Views: 993
Reputation: 16274
I only now learned of a nicer way. Undocumented but nice:
User.joins(:address).merge(Address.foreign)
as an alternative to
User.joins(:address).where(Address.foreign.where_values)
Upvotes: 1
Reputation: 1555
I posted a long answer here: How to test a scope in Rails 3
But the main answer is use #where_values_hash or #to_sql on your scope.
Upvotes: 2