diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 11:28:01 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 11:28:01 -0700 |
commit | 2e8a3d0f43d7b394873ce21396ae49feacb99a74 (patch) | |
tree | c96ed1d8b2bdc8b33dd7ee0e6bece71bf5bf674c /activerecord/lib/active_record/relation | |
parent | 604281221ce0eb71d7b922be2cd012018cca1fbf (diff) | |
download | rails-2e8a3d0f43d7b394873ce21396ae49feacb99a74.tar.gz rails-2e8a3d0f43d7b394873ce21396ae49feacb99a74.tar.bz2 rails-2e8a3d0f43d7b394873ce21396ae49feacb99a74.zip |
removing useless code, cleaning variable names
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 6860da80d3..cee240e6a1 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -228,7 +228,6 @@ module ActiveRecord private def build_joins(relation, joins) - joined_associations = [] association_joins = [] joins = @joins_values.map {|j| j.respond_to?(:strip) ? j.strip : j}.uniq @@ -259,11 +258,8 @@ module ActiveRecord 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) |