aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-03-04 13:47:19 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-03-04 13:47:41 -0800
commitd6d98680120a049f2a7226214a40fa7ecdd178be (patch)
tree2abc10aa499293c6bac61babdab4891ac4e37b38 /activerecord/lib/active_record/associations
parenta327e62c2fef43848d6e86e73778e6c1fd58ad9b (diff)
downloadrails-d6d98680120a049f2a7226214a40fa7ecdd178be.tar.gz
rails-d6d98680120a049f2a7226214a40fa7ecdd178be.tar.bz2
rails-d6d98680120a049f2a7226214a40fa7ecdd178be.zip
start hiding the `scope_chain` data structure
Introduce a predicate method that doesn't need to build a scope chain, but also hides the data structure used for representing the scope chain.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb
index d64ab64c99..f7edfbfb5f 100644
--- a/activerecord/lib/active_record/associations/association.rb
+++ b/activerecord/lib/active_record/associations/association.rb
@@ -257,7 +257,7 @@ module ActiveRecord
# Returns true if statement cache should be skipped on the association reader.
def skip_statement_cache?
- reflection.scope_chain.any?(&:any?) ||
+ reflection.has_scope? ||
scope.eager_loading? ||
klass.scope_attributes? ||
reflection.source_reflection.active_record.default_scopes.any?