diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-12-11 21:28:11 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-12-11 21:28:11 +0900 |
commit | 61cd7bd65314fe53e42593875a7425385c596740 (patch) | |
tree | a5efa63506504162590aa6bcd80d7d59e4c916f3 /activerecord/lib/active_record | |
parent | 701fc768ae34a8824f0c2611214711f1023b057c (diff) | |
download | rails-61cd7bd65314fe53e42593875a7425385c596740.tar.gz rails-61cd7bd65314fe53e42593875a7425385c596740.tar.bz2 rails-61cd7bd65314fe53e42593875a7425385c596740.zip |
Simplify the regex for `unsigned?` method
It is enough to distinguish only the trailing `unsigned` and
`unsigned zerofill`.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql/column.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/column.rb b/activerecord/lib/active_record/connection_adapters/mysql/column.rb index c66d543752..1499c1681f 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql/column.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql/column.rb @@ -5,8 +5,7 @@ module ActiveRecord delegate :extra, to: :sql_type_metadata, allow_nil: true def unsigned? - # enum and set types do not allow being defined as unsigned. - !/\A(?:enum|set)\b/.match?(sql_type) && /\bunsigned\b/.match?(sql_type) + /\bunsigned(?: zerofill)?\z/.match?(sql_type) end def case_sensitive? |