Skip to content
Browse files

Remove useless InnerJoinDependency, inner joins are performed through

Arel::InnerJoin.
  • Loading branch information...
1 parent b342728 commit 3e1ef198e086deb4f212523ce2338a027f0e4155 @miloops miloops committed
Showing with 5 additions and 22 deletions.
  1. +4 −21 activerecord/lib/active_record/associations.rb
  2. +1 −1 activerecord/lib/active_record/base.rb
View
25 activerecord/lib/active_record/associations.rb
@@ -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
View
2 activerecord/lib/active_record/base.rb
@@ -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)

0 comments on commit 3e1ef19

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