Reputation: 24551
I really like how in Rails 3 you can ask a scope for its SQL like this:
User.admins.to_sql
Is there any way to do the same thing with a has_many
relation?:
User.first.jobs.to_sql
I've tried User.first.jobs.public_methods.grep /sql/
and other tricks, but I haven't turned up anything.
Upvotes: 3
Views: 484