Open rapind opened 7 years ago
precence validations should NOT be added for columns that have a default like this. this applies to array fields as well as json or jsonb fields (that have a default). As we are simply stating (for the DB) that we want it to never be null, but have a an empty representation by default.. {} or [].
We encounter this with
t.jsonb :my_field, null: false, default: {}
so for now.. it's schema_validations except: :my_field
Given the following migration:
t.text :my_field, array: true, null: false, default: []
There's still a presence validation being added when there shouldn't be.
This is w/ Version 2.2.1