diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-06-04 00:53:45 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-06-04 00:53:45 +0100 |
commit | 517f709b51d1d2766d1a783d9f02fa7a6a41abc4 (patch) | |
tree | 8b7e8f0ee8faca37f6a03eae6ccfa85a89e13d1b /activerecord/lib | |
parent | 3a066e81b34fbad93edce1776354f879f30ce4e8 (diff) | |
download | rails-517f709b51d1d2766d1a783d9f02fa7a6a41abc4.tar.gz rails-517f709b51d1d2766d1a783d9f02fa7a6a41abc4.tar.bz2 rails-517f709b51d1d2766d1a783d9f02fa7a6a41abc4.zip |
Properly cache association_collection#scopes calls having arguments
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 0dfd966466..d9903243ce 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -411,7 +411,8 @@ module ActiveRecord end elsif @reflection.klass.scopes[method] @_named_scopes_cache ||= {} - @_named_scopes_cache[method] ||= with_scope(construct_scope) { @reflection.klass.send(method, *args) } + @_named_scopes_cache[method] ||= {} + @_named_scopes_cache[method][args] ||= with_scope(construct_scope) { @reflection.klass.send(method, *args) } else with_scope(construct_scope) do if block_given? |