diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-19 16:08:54 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-19 16:08:54 -0300 |
commit | 3e1ef198e086deb4f212523ce2338a027f0e4155 (patch) | |
tree | 9f6311d7fcc0a00b11a93b3791124d5452007364 /activerecord/lib | |
parent | b3427286771bb476c0c4a58488033bd671740332 (diff) | |
download | rails-3e1ef198e086deb4f212523ce2338a027f0e4155.tar.gz rails-3e1ef198e086deb4f212523ce2338a027f0e4155.tar.bz2 rails-3e1ef198e086deb4f212523ce2338a027f0e4155.zip |
Remove useless InnerJoinDependency, inner joins are performed through
Arel::InnerJoin.
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 25 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
2 files changed, 5 insertions, 22 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 547df9c684..4e31f943bc 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1787,7 +1787,7 @@ module ActiveRecord 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 @@ module ActiveRecord 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 @@ module ActiveRecord 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 diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 1698f33da0..dc439ff92e 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1812,7 +1812,7 @@ module ActiveRecord #:nodoc: 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) |