Skip to content

Commit

Permalink
Always pass parameters to build
Browse files Browse the repository at this point in the history
We always know the parameters in advance, so we don't need to build it
in to the method signature
  • Loading branch information
tenderlove committed Oct 3, 2013
1 parent 8e1b363 commit 18a74f9
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -35,7 +35,7 @@ def initialize(base, associations, joins)
@reflections = []
@alias_tracker = AliasTracker.new(base.connection, joins)
@alias_tracker.aliased_name_for(base.table_name) # Updates the count for base.table_name to 1
build(associations)
build(associations, join_parts.last, Arel::InnerJoin)
end

def graft(*associations)
Expand Down Expand Up @@ -130,7 +130,7 @@ def cache_joined_association(association)
ref[association.reflection.name] ||= {}
end

def build(associations, parent = join_parts.last, join_type = Arel::InnerJoin)
def build(associations, parent, join_type)
case associations
when Symbol, String
reflection = parent.reflections[associations.intern] or
Expand Down

0 comments on commit 18a74f9

Please sign in to comment.