Skip to content

Commit

Permalink
join_type isn't used on the node anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 21, 2013
1 parent aa5affb commit fadb6d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
12 changes: 6 additions & 6 deletions activerecord/lib/active_record/associations/join_dependency.rb
Expand Up @@ -57,7 +57,7 @@ def initialize(base, associations, joins)
@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

Expand Down Expand Up @@ -213,23 +213,23 @@ def find_reflection(klass, name)
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)
Expand Down
Expand Up @@ -7,16 +7,12 @@ class JoinAssociation < JoinPart # :nodoc:
# 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

Expand Down

0 comments on commit fadb6d9

Please sign in to comment.