From d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 8 Oct 2013 18:03:42 -0700 Subject: parent is guaranteed to be the same since we are searching a tree, the current level should be consistent, so we don't have to inspect the parent class / table --- activerecord/lib/active_record/associations/join_dependency.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/join_dependency.rb') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index bfaac87e49..15e0053d6d 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -244,10 +244,7 @@ module ActiveRecord def construct_scalar(parent, associations, row, rs, nodes) name = associations.to_s - node = nodes.detect { |j| - j.name.to_s == name && - j.join_part.parent_table_name == parent.class.table_name - } + node = nodes.detect { |j| j.name.to_s == name } raise(ConfigurationError, "No such association") unless node -- cgit v1.2.3