aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index fe0066bbe1..199d28426b 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -203,9 +203,7 @@ module ActiveRecord
end
def find_join_association(reflection, parent)
- join_associations.detect { |j|
- j.reflection == reflection && node_cmp(j.parent, parent)
- }
+ parent.children.find { |j| j.reflection == reflection }
end
def remove_uniq_by_reflection(reflection, records)