Open bemueller opened 8 years ago
This was done on purpose with serialized fields in mind (YAML / JSON in TEXT columns), but I see how it doesn't make sense for HStore / native JSON.
It should at least be configurable.
Workaround - add a presence validation to your model for at least one of the fields with a default value, e.g. validates :bool, presence: true
, this way the create!
call will fail
Hi.
Due to the implementation of ActiveRecord::Type::Serialized#type_cast_for_database (Rails 4.2.5.x), in some cases default values aren't stored to the database.
This results in an inconsistent view on the database and makes it hard to select all Datas where bool is false.