diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 18:03:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 18:03:42 -0700 |
commit | d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39 (patch) | |
tree | 4c06d5cc2278ffb30b60db09ac2ebcce2464c0d1 | |
parent | 155fd955ac380c7877785f1b74b61ad86fd40772 (diff) | |
download | rails-d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39.tar.gz rails-d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39.tar.bz2 rails-d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39.zip |
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
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 5 |
1 files changed, 1 insertions, 4 deletions
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 |