diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-03-02 10:02:53 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-03-04 01:05:53 +0900 |
commit | 6f137bab6a7bf2209c17317c527c6933af9c58cc (patch) | |
tree | bbe140c2f21e1e884aee3cd1ad65f11c990cc10f /activerecord | |
parent | ba438dbfaed4d6bc62ffc519993770753eb74259 (diff) | |
download | rails-6f137bab6a7bf2209c17317c527c6933af9c58cc.tar.gz rails-6f137bab6a7bf2209c17317c527c6933af9c58cc.tar.bz2 rails-6f137bab6a7bf2209c17317c527c6933af9c58cc.zip |
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 |