aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/join_dependency.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-08 18:03:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-08 18:03:42 -0700
commitd0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39 (patch)
tree4c06d5cc2278ffb30b60db09ac2ebcce2464c0d1 /activerecord/lib/active_record/associations/join_dependency.rb
parent155fd955ac380c7877785f1b74b61ad86fd40772 (diff)
downloadrails-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
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb5
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