diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-24 17:19:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-25 05:17:49 -0700 |
commit | ce7c2f72f42f8f89517810fc6e51c21118af6a39 (patch) | |
tree | bfacb5e41839b9a1c297afd2d6662f52970e6b33 /activerecord/lib | |
parent | e1e712227197bcfb9564113eb3dd8ef6ffac243f (diff) | |
download | rails-ce7c2f72f42f8f89517810fc6e51c21118af6a39.tar.gz rails-ce7c2f72f42f8f89517810fc6e51c21118af6a39.tar.bz2 rails-ce7c2f72f42f8f89517810fc6e51c21118af6a39.zip |
refactor select { is_a? } to grep()
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 8ccc62c9d1..6fb97c6eb4 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -188,7 +188,7 @@ module ActiveRecord association_joins << join if [Hash, Array, Symbol].include?(join.class) && !array_of_strings?(join) end - stashed_association_joins = joins.select {|j| j.is_a?(ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation)} + stashed_association_joins = joins.grep(ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation) non_association_joins = (joins - association_joins - stashed_association_joins) custom_joins = custom_join_sql(*non_association_joins) |