Created
January 19, 2011 18:44
-
-
Save vinniefranco/786620 to your computer and use it in GitHub Desktop.
Fixes :limit => 0 for enumerated columns in rails 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixes :limit => 0 on enumerated columns, now you can test! | |
module ActiveRecord | |
module ConnectionAdapters | |
class Column | |
def extract_limit_with_enum(sql_type) | |
sql_type.scan(/enum/i)? 255 : extract_limit_without_enum(sql_type) | |
end | |
alias_method_chain :extract_limit, :enum | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment