You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rails_admin is creating new records with "" (empty string) rather than nil, and for a column where there is a unique index, allowing for nil, then this leads to a non-unique index violation, as the second record with a "" is reported as not unique.
The text was updated successfully, but these errors were encountered:
There could be a suggestion to use a gem like strip_attributes or auto_strip_attributes, and configure at models to strip the attributes that can be null. For me this solution worked fine . =D @justin808
But of course i had to check all attributes.
By default, empty strings passed into nullable columns get converted to nils.
You can disable that conversion by setting `treat_empty_as_nil false`.
Refs. #2099, Fixes#3172
rails_admin is creating new records with "" (empty string) rather than nil, and for a column where there is a unique index, allowing for nil, then this leads to a non-unique index violation, as the second record with a "" is reported as not unique.
The text was updated successfully, but these errors were encountered: