diff options
author | Vipul A M <vipulnsward@gmail.com> | 2014-12-25 22:40:32 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2014-12-25 22:40:32 +0530 |
commit | 1a9e47777c4c9202fadb4bd8bf496cf351bc06a1 (patch) | |
tree | ba8c1aed4d91eefe2b9b0a273cec1a9433a1f774 /activerecord | |
parent | d8e0b8ab557a40f1e01e3bb9eeefbcc155901181 (diff) | |
download | rails-1a9e47777c4c9202fadb4bd8bf496cf351bc06a1.tar.gz rails-1a9e47777c4c9202fadb4bd8bf496cf351bc06a1.tar.bz2 rails-1a9e47777c4c9202fadb4bd8bf496cf351bc06a1.zip |
- Changed `target` to `target_reflection` to avoid warning `possible reference to past scope`
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 7b6aefe345..16b1228b8a 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -597,8 +597,8 @@ module ActiveRecord if reflection.is_a?(ActiveRecord::Reflection::ThroughReflection) assoc = owner.association(reflection.through_reflection.name) assoc.reader.any? { |source| - target = source.send(reflection.source_reflection.name) - target.respond_to?(:include?) ? target.include?(record) : target == record + target_reflection = source.send(reflection.source_reflection.name) + target_reflection.respond_to?(:include?) ? target_reflection.include?(record) : target_reflection == record } || target.include?(record) else target.include?(record) |