diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-03-12 09:36:14 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-03-12 09:36:14 -0300 |
commit | 6b5f815cf832524ebcf7585a44bbb7e291423c71 (patch) | |
tree | 5544721aa8e8fd104aeae68a757de011d8599ae8 /activerecord/lib/active_record/associations | |
parent | 044f9ab7a4d6646ddce4560bb83b58cdc0baa751 (diff) | |
parent | c1deb81cd005d7091b680ec2089b9b8dba41325f (diff) | |
download | rails-6b5f815cf832524ebcf7585a44bbb7e291423c71.tar.gz rails-6b5f815cf832524ebcf7585a44bbb7e291423c71.tar.bz2 rails-6b5f815cf832524ebcf7585a44bbb7e291423c71.zip |
Merge pull request #19301 from Empact/default-scopes
Isolate access to .default_scopes in ActiveRecord::Scoping::Default
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/singular_association.rb | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 0ba03338f6..1e245926e0 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -432,8 +432,7 @@ module ActiveRecord def get_records if reflection.scope_chain.any?(&:any?) || scope.eager_loading? || - klass.current_scope || - klass.default_scopes.any? + klass.scope_attributes? return scope.to_a end diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index c44242a0f0..58d0f7d65d 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -41,8 +41,7 @@ module ActiveRecord def get_records if reflection.scope_chain.any?(&:any?) || scope.eager_loading? || - klass.current_scope || - klass.default_scopes.any? + klass.scope_attributes? return scope.limit(1).to_a end |