diff options
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index dace5503e5..f12d5c49b5 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -182,7 +182,8 @@ module ActiveRecord def build(associations, parent, join_type) associations.each do |name, right| reflection = find_reflection parent.base_klass, name - join_association = find_or_build_scalar reflection, parent, join_type + join_association = build_join_association reflection, parent, join_type + @join_parts << join_association build right, join_association, join_type end end |