diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-20 17:45:10 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-20 17:45:10 -0200 |
commit | 37bef5827f94137f4542cacc669e9c3ce6c9495d (patch) | |
tree | 3c0b9379da5e2f68a459e52ac0910e51ee0bf85c /activerecord/lib/active_record/associations | |
parent | 192d319fdbb5b1575b5541bb5395c87d87fadfa1 (diff) | |
parent | 9d569585a20ddd9ddb3602921f2ccffc208998d8 (diff) | |
download | rails-37bef5827f94137f4542cacc669e9c3ce6c9495d.tar.gz rails-37bef5827f94137f4542cacc669e9c3ce6c9495d.tar.bz2 rails-37bef5827f94137f4542cacc669e9c3ce6c9495d.zip |
Merge pull request #16989 from Empact/reload-cache-clear
Isolate access to @associations_cache and @aggregations_cache to the Associations and Aggregations modules, respectively.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 10 |
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 fcf06323e6..81eb5136a1 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -239,12 +239,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) |