diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2014-12-26 00:04:04 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2014-12-26 00:04:04 -0500 |
commit | 9a2194245d6389d6b173c378466c38c6359100a3 (patch) | |
tree | e1f6298fc3e49e1cb3b65a7cc4a759f9d6f56e32 /activerecord/lib/active_record/associations/collection_association.rb | |
parent | 097250e0d89dc80413e09e503c54d467e920a5e5 (diff) | |
parent | 1a9e47777c4c9202fadb4bd8bf496cf351bc06a1 (diff) | |
download | rails-9a2194245d6389d6b173c378466c38c6359100a3.tar.gz rails-9a2194245d6389d6b173c378466c38c6359100a3.tar.bz2 rails-9a2194245d6389d6b173c378466c38c6359100a3.zip |
Merge pull request #18197 from vipulnsward/fix-ar-2-2warning
Fixed AR warning on ruby 2.2
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_association.rb')
-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) |