Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor select { is_a? } to grep()

  • Loading branch information...
commit da7a28027a99548a79b970c807d40760e0fadb5f 1 parent bfe956d
Aaron Patterson tenderlove authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/relation/query_methods.rb
2  activerecord/lib/active_record/relation/query_methods.rb
View
@@ -188,7 +188,7 @@ def build_joins(relation, joins)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.