- Changed target to target_reflection to avoid warning possible reference to past scope

This commit is contained in:
Vipul A M 2014-12-25 22:40:32 +05:30
parent d8e0b8ab55
commit 1a9e47777c

@ -597,8 +597,8 @@ def include_in_memory?(record)
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)