This project is archived and is in readonly mode.
Query cache broken when using associations with scopes
-
Neeraj Singh
- Tag changed from 3.0 to 3.0, activerecord
Attached is a failing test. I am using ruby 1.8.7 and am able to reproduce it.
-
Neeraj Singh
It is not a query caching issue. It is named_scope_caching issue. Second time sql is not being generated becuase named_scopes_cache has memoized the input data.
@_named_scopes_cache ||= {} @_named_scopes_cache[method] ||= with_scope(construct_scope) { @reflection.klass.send(method, *args) } -
Neeraj Singh
- Tag changed from 3.0, activerecord to 3.0, activerecord, patch, scope
Attached is patch along with test.
-
Neeraj Singh
- Assigned user set to Pratik
Assigning this ticket to Pratik so that he could close it. He just committed http://github.com/rails/rails/commit/517f709b51d1d2766d1a783d9f02fa... which fixes this issue.
