diff options
author | Yves Senn <yves.senn@gmail.com> | 2016-07-27 08:20:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-27 08:20:22 +0200 |
commit | d0f8061cae576f7bdb89b2bceaf999b511403a3a (patch) | |
tree | da5d46b4eed23ef270ed564dab4e4d0affa0c047 /activerecord/lib/active_record | |
parent | 1a2f1c48bdeda5df88e8031fe51943527ebc381e (diff) | |
parent | a3a6d74c7774fc9f5df4f171bf6e7926c77fbe64 (diff) | |
download | rails-d0f8061cae576f7bdb89b2bceaf999b511403a3a.tar.gz rails-d0f8061cae576f7bdb89b2bceaf999b511403a3a.tar.bz2 rails-d0f8061cae576f7bdb89b2bceaf999b511403a3a.zip |
Merge pull request #25408 from kamipo/should_not_reuse_quoted_true
Quoting booleans should return a frozen string
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql/quoting.rb | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index 9af6a673d3..0a58921549 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -112,19 +112,19 @@ module ActiveRecord end def quoted_true - "'t'" + "'t'".freeze end def unquoted_true - 't' + 't'.freeze end def quoted_false - "'f'" + "'f'".freeze end def unquoted_false - 'f' + 'f'.freeze end # Quote date/time values for use in SQL input. Includes microseconds diff --git a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb index fbab654112..5b59e39d9f 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb @@ -2,7 +2,7 @@ module ActiveRecord module ConnectionAdapters module MySQL module Quoting # :nodoc: - QUOTED_TRUE, QUOTED_FALSE = '1', '0' + QUOTED_TRUE, QUOTED_FALSE = '1'.freeze, '0'.freeze def quote_column_name(name) @quoted_column_names[name] ||= "`#{super.gsub('`', '``')}`" |