From fadb6d923beb5a45650e6bb73c238538917c25e4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 21 Oct 2013 14:56:46 -0700 Subject: join_type isn't used on the node anymore --- .../lib/active_record/associations/join_dependency.rb | 12 ++++++------ .../associations/join_dependency/join_association.rb | 6 +----- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index fb893da0da..2bcea3b00a 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -57,7 +57,7 @@ module ActiveRecord @alias_tracker = AliasTracker.new(base.connection, joins) @alias_tracker.aliased_name_for(base.table_name) # Updates the count for base.table_name to 1 tree = self.class.make_tree associations - build tree, @join_root, Arel::InnerJoin + build tree, @join_root @join_root.children.each { |child| construct_tables! @join_root, child } end @@ -213,23 +213,23 @@ module ActiveRecord raise ConfigurationError, "Association named '#{ name }' was not found on #{ klass.name }; perhaps you misspelled it?" end - def build(associations, parent, join_type) + def build(associations, parent) associations.each do |name, right| reflection = find_reflection parent.base_klass, name - join_association = build_join_association reflection, parent, join_type + join_association = build_join_association reflection parent.children << join_association - build right, join_association, join_type + build right, join_association end end - def build_join_association(reflection, parent, join_type) + def build_join_association(reflection) reflection.check_validity! if reflection.options[:polymorphic] raise EagerLoadPolymorphicError.new(reflection) end - JoinAssociation.new(reflection, join_type) + JoinAssociation.new(reflection) end def construct(ar_parent, parent, row, rs, seen, model_cache, aliases) 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 4a70dc9e26..d2c090ae56 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -7,16 +7,12 @@ module ActiveRecord # The reflection of the association represented attr_reader :reflection - # What type of join will be generated, either Arel::InnerJoin (default) or Arel::OuterJoin - attr_accessor :join_type - attr_accessor :tables - def initialize(reflection, join_type) + def initialize(reflection) super(reflection.klass) @reflection = reflection - @join_type = join_type @tables = nil end -- cgit v1.2.3