Skip to content

Commit

Permalink
subtracting blank strings is slightly faster than blank?
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 11, 2010
1 parent 36cb62e commit c8509d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -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.

Copy link
@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.

Copy link
@tenderlove

tenderlove Aug 12, 2010

Author 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)
Expand Down

0 comments on commit c8509d5

Please sign in to comment.