aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 25ffa7860e..6c4e84a958 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -184,16 +184,16 @@ module ActiveRecord
builder = PredicateBuilder.new(table.engine)
- conditions = if [String, Array].include?(args.first.class)
- @klass.send(:sanitize_sql, args.size > 1 ? args : args.first)
- elsif args.first.is_a?(Hash)
- attributes = @klass.send(:expand_hash_conditions_for_aggregates, args.first)
+ opts = args.first
+ case opts
+ when String, Array
+ @klass.send(:sanitize_sql, args.size > 1 ? args : opts)
+ when Hash
+ attributes = @klass.send(:expand_hash_conditions_for_aggregates, opts)
builder.build_from_hash(attributes, table)
else
- args.first
+ opts
end
-
- conditions
end
private