Permalink
Browse files

subtracting blank strings is slightly faster than blank?

  • Loading branch information...
tenderlove committed Aug 11, 2010
1 parent 36cb62e commit c8509d5303db0fd0930d09357b059bb4a6b19f9f
Showing with 1 addition and 3 deletions.
  1. +1 −3 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|

This comment has been minimized.

Show comment
Hide comment
@yury

yury Aug 12, 2010

Contributor

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

@yury

yury Aug 12, 2010

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@tenderlove

tenderlove Aug 12, 2010

Member

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

@tenderlove

tenderlove Aug 12, 2010

Member

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

case where
when Arel::SqlLiteral
arel = arel.where(where)

0 comments on commit c8509d5

Please sign in to comment.