diff options
author | Patrick Rebsch <pjrebsch@gmail.com> | 2019-03-01 20:31:59 -0500 |
---|---|---|
committer | Patrick Rebsch <pjrebsch@gmail.com> | 2019-03-07 19:22:29 -0500 |
commit | 3e6d3e430e53c550e3c282af6f23b803e1652b15 (patch) | |
tree | 59f7b6db3bec125e632a7cb908945312473cf69d /activerecord/lib | |
parent | a62683f3e4326b222b6ad95b8b2dfcc31026d227 (diff) | |
download | rails-3e6d3e430e53c550e3c282af6f23b803e1652b15.tar.gz rails-3e6d3e430e53c550e3c282af6f23b803e1652b15.tar.bz2 rails-3e6d3e430e53c550e3c282af6f23b803e1652b15.zip |
Quote empty ranges like other empty enumerables
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index e6197752bc..750766714d 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -165,10 +165,11 @@ module ActiveRecord def quote_bound_value(value, c = connection) if value.respond_to?(:map) && !value.acts_like?(:string) - if value.respond_to?(:empty?) && value.empty? + quoted = value.map { |v| c.quote(v) } + if quoted.empty? c.quote(nil) else - value.map { |v| c.quote(v) }.join(",") + quoted.join(",") end else c.quote(value) |