diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-03-07 09:44:59 -0700 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-03-07 09:44:59 -0700 |
commit | 591bbfd1f785fdb27705656b2818020750bb1fa8 (patch) | |
tree | 7a6ee788066fb195ac267bf91d3a65e1d11f029a /activerecord | |
parent | ab7ad20125c0e0a199100fc12c2b7d67d90a6308 (diff) | |
parent | 6f137bab6a7bf2209c17317c527c6933af9c58cc (diff) | |
download | rails-591bbfd1f785fdb27705656b2818020750bb1fa8.tar.gz rails-591bbfd1f785fdb27705656b2818020750bb1fa8.tar.bz2 rails-591bbfd1f785fdb27705656b2818020750bb1fa8.zip |
Merge pull request #23993 from kamipo/no_need_to_extract_limit_for_boolean
No need to extract a limit for a boolean type
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb | 4 |
2 files changed, 1 insertions, 5 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 b12bac2737..50f461b746 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -668,7 +668,7 @@ module ActiveRecord register_integer_type m, %r(^smallint)i, limit: 2 register_integer_type m, %r(^tinyint)i, limit: 1 - m.alias_type %r(tinyint\(1\))i, 'boolean' if emulate_booleans + m.register_type %r(^tinyint\(1\))i, Type::Boolean.new if emulate_booleans m.alias_type %r(year)i, 'integer' m.alias_type %r(bit)i, 'binary' diff --git a/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb b/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb index 3cdd46236b..914ea98f79 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb @@ -38,10 +38,6 @@ module ActiveRecord end end - def schema_limit(column) - super unless column.type == :boolean - end - def schema_precision(column) super unless /time/ === column.sql_type && column.precision == 0 end |