From 7de03ec765e3160f5331fc17c8d7d332fa679d62 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 11 Aug 2010 15:31:44 -0700 Subject: [PATCH] subtracting blank strings is slightly faster than blank? --- activerecord/lib/active_record/relation/query_methods.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 0ea662f310..cd6c6f8d1f 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -135,9 +135,7 @@ def build_arel arel = build_joins(arel, @joins_values) unless @joins_values.empty? - @where_values.uniq.each do |where| - next if where.blank? - + (@where_values - ['']).uniq.each do |where| case where when Arel::SqlLiteral arel = arel.where(where) -- GitLab