Why are ActiveRecord scopes not merged ?
May 26th, 2008
Does anyone know why ActiveRecord does not merge joins when using scopes ?
Scopes are wonderful, thanks for has_finder and named scopes, but joins aren’t supported. This code:
raises an ActiveRecord::StatementInvalid complaining that a specified column could not be found. The column can’t be found because the join was dropped on the floor, instead of being merged.
The change me and Marc-André are proposing to make is this:
This is based on Rails 2.0.2, but Rails Edge has the same problem. So, any ideas ?
May 27th, 2008 at 01:08 PM
I’d like to see this too. You should submit this patch to rails.lighthouseapp.com if you haven’t already.