#93: inspecting the state of a named_scope

Solved!
I know named scopes are getting all changed around in Rails 3, but I figured this out a while ago, and then forgot it, came here to find my answer, and realized I never wrote it down.

The problem is that when you're building complex chained scopes its often useful to examine the state of the query, particularly if you're doing a lot of joins and you don't want to join on the same table twice.

proxy_options

1
>> scope = YourModel.scoped({}) >> scope = scope.some_scope(some_arg) >> scope.proxy_options[:joins] => "INNER JOIN piffles on piffles.your_model_id = your_models.id"

Think you've got a better solution? Help 148c663fd665c53518538e093ce3c2ab_small kueda out by posting your solution