From 1fb78e3ed8142782f19877a195f10b1828dd672c Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 20 Jan 2010 20:37:03 +0530 Subject: Base.merge_conditions is no longer needed --- activerecord/lib/active_record/relation/query_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/relation') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 163d698b5c..bad6fd716b 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -167,8 +167,8 @@ module ActiveRecord builder = PredicateBuilder.new(table.engine) conditions = if [String, Array].include?(args.first.class) - merged = @klass.send(:merge_conditions, args.size > 1 ? Array.wrap(args) : args.first) - Arel::SqlLiteral.new(merged) if merged + sql = @klass.send(:sanitize_sql, args.size > 1 ? args : args.first) + Arel::SqlLiteral.new("(#{sql})") if sql.present? elsif args.first.is_a?(Hash) attributes = @klass.send(:expand_hash_conditions_for_aggregates, args.first) builder.build_from_hash(attributes, table) -- cgit v1.2.3