Skip to content

Instantly share code, notes, and snippets.

@vinniefranco
Created January 19, 2011 18:44
Show Gist options
  • Save vinniefranco/786620 to your computer and use it in GitHub Desktop.
Save vinniefranco/786620 to your computer and use it in GitHub Desktop.
Fixes :limit => 0 for enumerated columns in rails 3
# 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