diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-07 16:42:14 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-30 18:26:03 +0900 |
commit | 1c4be603c121a8853a4f1d6c13cb91f9b66bef9e (patch) | |
tree | b189e2cc2c8a1eaaa35b605e910818971b6208f0 /activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | |
parent | 5d9d6a4fbf72029266bfa643929a9a80f9286fbe (diff) | |
download | rails-1c4be603c121a8853a4f1d6c13cb91f9b66bef9e.tar.gz rails-1c4be603c121a8853a4f1d6c13cb91f9b66bef9e.tar.bz2 rails-1c4be603c121a8853a4f1d6c13cb91f9b66bef9e.zip |
Consolidate database specific JSON types to `Type::Json`
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 5 |
1 files changed, 2 insertions, 3 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 01599985ca..648c869915 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -543,7 +543,7 @@ module ActiveRecord m.register_type %r(longblob)i, Type::Binary.new(limit: 2**32 - 1) m.register_type %r(^float)i, Type::Float.new(limit: 24) m.register_type %r(^double)i, Type::Float.new(limit: 53) - m.register_type %r(^json)i, MysqlJson.new + m.register_type %r(^json)i, Type::Json.new register_integer_type m, %r(^bigint)i, limit: 8 register_integer_type m, %r(^int)i, limit: 4 @@ -837,7 +837,7 @@ module ActiveRecord end end - class MysqlJson < Type::Internal::AbstractJson # :nodoc: + class MysqlJson < Type::Json # :nodoc: end class MysqlString < Type::String # :nodoc: @@ -860,7 +860,6 @@ module ActiveRecord end end - ActiveRecord::Type.register(:json, MysqlJson, adapter: :mysql2) ActiveRecord::Type.register(:string, MysqlString, adapter: :mysql2) ActiveRecord::Type.register(:unsigned_integer, Type::UnsignedInteger, adapter: :mysql2) end |