1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #18197 from vipulnsward/fix-ar-2-2warning

Fixed AR warning on ruby 2.2
This commit is contained in:
Guillermo Iguaran 2014-12-26 00:04:04 -05:00
commit 9a2194245d

View file

@ -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)