diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-20 13:11:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-20 13:11:38 -0700 |
commit | bae5e02cf33311318be9c7272852bbaef976bd7e (patch) | |
tree | a13213a22d04cfd28a918efefba62f436748627d /activerecord/lib/active_record | |
parent | 2549f6d8ee104d1f83f573f5057c5f5e7c699608 (diff) | |
download | rails-bae5e02cf33311318be9c7272852bbaef976bd7e.tar.gz rails-bae5e02cf33311318be9c7272852bbaef976bd7e.tar.bz2 rails-bae5e02cf33311318be9c7272852bbaef976bd7e.zip |
pass the join type to the join_constraints method
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 2ea8eb69d7..030049d000 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -165,7 +165,8 @@ module ActiveRecord def make_joins(node) node.children.flat_map { |child| - child.join_constraints(node, child.tables, child.reflection.chain) + chain = child.reflection.chain + child.join_constraints(node, child.join_type, child.tables, chain) .concat make_joins(child) } end diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index 9677d1219a..9204fa3a56 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -25,7 +25,7 @@ module ActiveRecord super && reflection == other.reflection end - def join_constraints(parent, tables, chain) + def join_constraints(parent, join_type, tables, chain) joins = [] tables = tables.reverse |