thoughtbot--shoulda-matchers/lib
Geoff Harcourt 68dd70a23d Validate enum column is an integer in `define_enum_for`
If your ActiveRecord model stores its `enum` data in a non-integer
column, ActiveRecord will save the data without error. However, when you
access the attribute on the record after saving, AR will look for the
string to what it expects to be a list of numbers and return `nil`
rather than the mapped value.

This change adds a third criterion to the `define_enum_for` matcher,
verifying that the underlying database column has a `sql_type` of
`"integer"`.

Fix #827.
2016-01-10 21:40:15 -07:00
..
shoulda Validate enum column is an integer in `define_enum_for` 2016-01-10 21:40:15 -07:00
shoulda-matchers.rb Switched to allowing a more canonical require statement 2011-01-31 16:45:13 -05:00