aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2014-09-20 09:03:03 -0700
committerBen Woosley <ben.woosley@gmail.com>2014-09-28 16:17:06 -0700
commit9d569585a20ddd9ddb3602921f2ccffc208998d8 (patch)
tree97f5ee9a38a958f3bf60c1f1f972b8549f9cedb5 /activerecord/lib/active_record/associations
parent482e80e84440136763b47c0fba2ed65a7823f022 (diff)
downloadrails-9d569585a20ddd9ddb3602921f2ccffc208998d8.tar.gz
rails-9d569585a20ddd9ddb3602921f2ccffc208998d8.tar.bz2
rails-9d569585a20ddd9ddb3602921f2ccffc208998d8.zip
Isolate access to @associations_cache and @aggregations cache to the Associations and Aggregations modules, respectively.
This includes replacing the `association_cache` accessor with a more limited `association_cached?` accessor and making `clear_association_cache` and `clear_aggregation_cache` private.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index ec5c189cd3..65b6ada737 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -230,12 +230,10 @@ module ActiveRecord
if node.reflection.collection?
other = ar_parent.association(node.reflection.name)
other.loaded!
- else
- if ar_parent.association_cache.key?(node.reflection.name)
- model = ar_parent.association(node.reflection.name).target
- construct(model, node, row, rs, seen, model_cache, aliases)
- next
- end
+ elsif ar_parent.association_cached?(node.reflection.name)
+ model = ar_parent.association(node.reflection.name).target
+ construct(model, node, row, rs, seen, model_cache, aliases)
+ next
end
key = aliases.column_alias(node, node.primary_key)