Skip to content
Browse files

subtracting blank strings is slightly faster than blank?

  • Loading branch information...
1 parent 36cb62e commit c8509d5303db0fd0930d09357b059bb4a6b19f9f @tenderlove tenderlove committed Aug 11, 2010
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/relation/query_methods.rb
4 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|
yury added a note Aug 12, 2010

not equal change. nil values are skipped. I think it should be @where_values - ['', nil]

Ruby on Rails member
tenderlove added a note Aug 12, 2010

I don't think it is possible for nil values to be in the array at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
case where
when Arel::SqlLiteral
arel = arel.where(where)

0 comments on commit c8509d5

Please sign in to comment.
Something went wrong with that request. Please try again.