Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build PredicateBuilder object only when needed

  • Loading branch information...
commit 2ff73039bdb6880af5586d8e4d6960b34cdf00ce 1 parent da32661
@lifo lifo authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/relation/query_methods.rb
View
4 activerecord/lib/active_record/relation/query_methods.rb
@@ -187,15 +187,13 @@ def build_arel
def build_where(*args)
return if args.blank?
- builder = PredicateBuilder.new(table.engine)
-
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)
+ PredicateBuilder.new(table.engine).build_from_hash(attributes, table)
else
opts
end
Please sign in to comment.
Something went wrong with that request. Please try again.