aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-06 15:38:05 -0700
committerXavier Noria <fxn@hashref.com>2010-04-06 15:38:05 -0700
commit4c4fd1a60ff1c060e76e9ee540074756510f53ea (patch)
tree77da1c66c127e36c8b00825b676d9267a9ef4cd6 /activerecord/lib/active_record/associations
parent03cb74b9461293b96ae0add8ff5efda132dabba0 (diff)
parentaf130575249571464ec984efa84fcea1267e8cf8 (diff)
downloadrails-4c4fd1a60ff1c060e76e9ee540074756510f53ea.tar.gz
rails-4c4fd1a60ff1c060e76e9ee540074756510f53ea.tar.bz2
rails-4c4fd1a60ff1c060e76e9ee540074756510f53ea.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb
index 6eda70d0ce..5ecdf1ac8d 100644
--- a/activerecord/lib/active_record/associations/association_collection.rb
+++ b/activerecord/lib/active_record/associations/association_collection.rb
@@ -405,6 +405,9 @@ module ActiveRecord
else
super
end
+ elsif @reflection.klass.scopes[method]
+ @_scopes ||= {}
+ @_scopes[method] ||= with_scope(construct_scope) { @reflection.klass.send(method, *args) }
else
with_scope(construct_scope) do
if block_given?