Permalink
Browse files

Fixed bug where enums limit were getting set as 0

  • Loading branch information...
1 parent edb87b1 commit 3e5d8a27be58ea828a8b3a6a860853e1e64d18ee @thiagofm thiagofm committed May 22, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
View
2 activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -67,6 +67,8 @@ def extract_limit(sql_type)
else
super # we could return 65535 here, but we leave it undecorated by default
end
+ when /^enum\((.*)\)/i
+ $1.split(',').collect{ |value| value.size-2 }.max
when /^bigint/i; 8
when /^int/i; 4
when /^mediumint/i; 3

0 comments on commit 3e5d8a2

Please sign in to comment.