aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-04-18 14:00:46 -0600
committerSean Griffin <sean@seantheprogrammer.com>2016-04-18 14:00:46 -0600
commitd63054bbcbdc4d84e4c27560944aa24f1e9c60a8 (patch)
treed9a8335ee68ac53a24769466b31d8730f4486683 /activerecord
parent485e7f25f29ca1ca23bb214b802cf68840dabbb6 (diff)
parent1a9eb19ac4eac90b514eb3572399a9875aa30beb (diff)
downloadrails-d63054bbcbdc4d84e4c27560944aa24f1e9c60a8.tar.gz
rails-d63054bbcbdc4d84e4c27560944aa24f1e9c60a8.tar.bz2
rails-d63054bbcbdc4d84e4c27560944aa24f1e9c60a8.zip
Merge pull request #24607 from vipulnsward/where-clause-frozen-array
Don't create new arrays when trying to compute non_empty_predicates for ast generation
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/where_clause.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/where_clause.rb b/activerecord/lib/active_record/relation/where_clause.rb
index 2c2d6cfa47..89396b518c 100644
--- a/activerecord/lib/active_record/relation/where_clause.rb
+++ b/activerecord/lib/active_record/relation/where_clause.rb
@@ -158,8 +158,9 @@ module ActiveRecord
end
end
+ ARRAY_WITH_EMPTY_STRING = ['']
def non_empty_predicates
- predicates - ['']
+ predicates - ARRAY_WITH_EMPTY_STRING
end
def wrap_sql_literal(node)