提交 3e1ef198 编写于 作者: E Emilio Tagua

Remove useless InnerJoinDependency, inner joins are performed through

Arel::InnerJoin.
上级 b3427286
......@@ -1787,7 +1787,7 @@ def joined_tables(options)
if array_of_strings?(merged_joins)
tables_in_string(merged_joins.join(' '))
else
join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, merged_joins, nil)
join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, merged_joins, nil)
join_dependency.join_associations.collect {|join_association| [join_association.aliased_join_table_name, join_association.aliased_table_name]}.flatten.compact
end
else
......@@ -2216,17 +2216,13 @@ def relation
end
end
def join_type
Arel::OuterJoin
end
def join_relation(joining_relation, join = nil)
if relation.is_a?(Array)
joining_relation.
joins(relation.first, join_type).on(association_join.first).
joins(relation.last, join_type).on(association_join.last)
joins(relation.first, Arel::OuterJoin).on(association_join.first).
joins(relation.last, Arel::OuterJoin).on(association_join.last)
else
joining_relation.joins(relation, join_type).on(association_join)
joining_relation.joins(relation, Arel::OuterJoin).on(association_join)
end
end
......@@ -2267,19 +2263,6 @@ def interpolate_sql(sql)
end
end
end
class InnerJoinDependency < JoinDependency # :nodoc:
protected
def build_join_association(reflection, parent)
InnerJoinAssociation.new(reflection, self, parent)
end
class InnerJoinAssociation < JoinAssociation
def join_type
Arel::InnerJoin
end
end
end
end
end
end
......@@ -1812,7 +1812,7 @@ def merge_joins(*joins)
end
def build_association_joins(joins)
join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, joins, nil)
join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, joins, nil)
relation = arel_table.relation
join_dependency.join_associations.map { |association|
if association.relation.is_a?(Array)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册