waka / activerecord-mysql-unsigned

Enable to use the "unsigned" option in the integer type for migrating of ActiveRecord
MIT License
31 stars 12 forks source link

Introspectively add numeric, >=0, null validations for unsigned columns #24

Open saizai opened 9 years ago

saizai commented 9 years ago

It'd be nice if the gem automatically made integer columns have validations (via introspection), e.g.:

validates column, numericality: { only_integer: true, greater_than_or_equal_to: 0, presence: !column_allows_nil }