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:
commit
9a2194245d
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue