diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-04-06 13:22:52 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-04-06 14:28:30 +0900 |
commit | cc7f39aa63d63928df33b77add34d9f1acb782f1 (patch) | |
tree | 2a6794c49640b855eb052ab3cfbe64cc508c1cf8 | |
parent | 83c337a4ab675a137397f83b74e6e0132c358164 (diff) | |
download | rails-cc7f39aa63d63928df33b77add34d9f1acb782f1.tar.gz rails-cc7f39aa63d63928df33b77add34d9f1acb782f1.tar.bz2 rails-cc7f39aa63d63928df33b77add34d9f1acb782f1.zip |
Make `QUOTED_TRUE` and `QUOTED_FALSE` to public because these are used in `MysqlString`
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql/quoting.rb | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 1a24b64984..e9ce1ba71f 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -909,8 +909,8 @@ module ActiveRecord class MysqlString < Type::String # :nodoc: def serialize(value) case value - when true then QUOTED_TRUE - when false then QUOTED_FALSE + when true then MySQL::Quoting::QUOTED_TRUE + when false then MySQL::Quoting::QUOTED_FALSE else super end end @@ -919,8 +919,8 @@ module ActiveRecord def cast_value(value) case value - when true then QUOTED_TRUE - when false then QUOTED_FALSE + when true then MySQL::Quoting::QUOTED_TRUE + when false then MySQL::Quoting::QUOTED_FALSE else super end end diff --git a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb index bc0608d16e..fbab654112 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb @@ -2,6 +2,8 @@ module ActiveRecord module ConnectionAdapters module MySQL module Quoting # :nodoc: + QUOTED_TRUE, QUOTED_FALSE = '1', '0' + def quote_column_name(name) @quoted_column_names[name] ||= "`#{super.gsub('`', '``')}`" end @@ -36,8 +38,6 @@ module ActiveRecord private - QUOTED_TRUE, QUOTED_FALSE = '1', '0' - def _quote(value) if value.is_a?(Type::Binary::Data) "x'#{value.hex}'" |