diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 18:46:56 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 18:46:56 -0800 |
commit | 542cb5c327f92d3f6ae6159a54e86949441f095e (patch) | |
tree | a299d272ac83612f0b1cf8233b8158f2585242f2 /activerecord/lib/active_record/relation | |
parent | 10b1887a719588c1252906169f9d3d12ee1387c6 (diff) | |
download | rails-542cb5c327f92d3f6ae6159a54e86949441f095e.tar.gz rails-542cb5c327f92d3f6ae6159a54e86949441f095e.tar.bz2 rails-542cb5c327f92d3f6ae6159a54e86949441f095e.zip |
fix warnings, stop using global variables
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 30cd4f4477..0483950db7 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -243,12 +243,10 @@ module ActiveRecord end def build_joins(relation, joins) - association_joins = [] - joins = joins.map {|j| j.respond_to?(:strip) ? j.strip : j}.uniq - joins.each do |join| - association_joins << join if [Hash, Array, Symbol].include?(join.class) && !array_of_strings?(join) + association_joins = joins.find_all do |join| + [Hash, Array, Symbol].include?(join.class) && !array_of_strings?(join) end stashed_association_joins = joins.grep(ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation) |