Skip to content

Commit

Permalink
removing useless code, cleaning variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Sep 7, 2010
1 parent 6042812 commit 2e8a3d0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -228,7 +228,6 @@ def build_where(opts, other = [])
private

def build_joins(relation, joins)
joined_associations = []
association_joins = []

joins = @joins_values.map {|j| j.respond_to?(:strip) ? j.strip : j}.uniq
Expand Down Expand Up @@ -259,11 +258,8 @@ def build_joins(relation, joins)
end
end

to_join.each do |tj|
unless joined_associations.detect {|ja| ja[0] == tj[0] && ja[1] == tj[1] && ja[2] == tj[2] }
joined_associations << tj
relation = relation.join(tj[0], tj[1]).on(*tj[2])
end
to_join.uniq.each do |left, join_class, right|
relation = relation.join(left, join_class).on(*right)
end

relation.join(custom_joins)
Expand Down

0 comments on commit 2e8a3d0

Please sign in to comment.