Skip to content
This repository
Browse code

subtracting blank strings is slightly faster than blank?

  • Loading branch information...
commit c8509d5303db0fd0930d09357b059bb4a6b19f9f 1 parent 36cb62e
Aaron Patterson tenderlove authored
4 activerecord/lib/active_record/relation/query_methods.rb
@@ -135,9 +135,7 @@ def build_arel
135 135
136 136 arel = build_joins(arel, @joins_values) unless @joins_values.empty?
137 137
138   - @where_values.uniq.each do |where|
139   - next if where.blank?
140   -
  138 + (@where_values - ['']).uniq.each do |where|
141 139 case where
142 140 when Arel::SqlLiteral
143 141 arel = arel.where(where)

0 comments on commit c8509d5

Yury Korolev

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

Aaron Patterson

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

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