Skip to content
Browse files

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
  • Loading branch information...
1 parent 155fd95 commit d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39 @tenderlove tenderlove committed Oct 8, 2013
Showing with 1 addition and 4 deletions.
  1. +1 −4 activerecord/lib/active_record/associations/join_dependency.rb
View
5 activerecord/lib/active_record/associations/join_dependency.rb
@@ -244,10 +244,7 @@ def construct(parent, nodes, row, rs)
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

0 comments on commit d0e36c6

Please sign in to comment.
Something went wrong with that request. Please try again.