diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-27 11:20:23 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-28 17:24:09 -0300 |
commit | 48601c27b7942a18482bc817321a1ce9effece20 (patch) | |
tree | 0ab1aa8408668e43987e9edf49fb2b5006cb17f3 /activerecord/lib/active_record/connection_adapters | |
parent | 10e568577536460647f97dbcc5b9d1777937f5e8 (diff) | |
download | rails-48601c27b7942a18482bc817321a1ce9effece20.tar.gz rails-48601c27b7942a18482bc817321a1ce9effece20.tar.bz2 rails-48601c27b7942a18482bc817321a1ce9effece20.zip |
Merge pull request #6878 from masarakki/master
fix bug in limit of enum columns of mysql
Closes #6432
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 2 |
1 files changed, 2 insertions, 0 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 88f82b5e35..e3cda4bf88 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -72,6 +72,8 @@ module ActiveRecord when /^mediumint/i; 3 when /^smallint/i; 2 when /^tinyint/i; 1 + when /^enum\((.+)\)/i + $1.split(',').map{|enum| enum.strip.length - 2}.max else super end |