Open vitormd opened 6 years ago
Same here.
Looking for work-arounds: https://stackoverflow.com/questions/58100255/rails-admin-wont-let-me-keep-my-enum-field-as-nil
This problem is present when the database column is an integer. It might not be present if using Postgres ENUM field type.
If you declare your enum as a hash (not an array), and don't assign anything to 0, it works.
In my case enum recurrence: { daily: 0, weekly: 1, monthly: 2, annually: 3 }
becomes enum recurrence: { daily: 1, weekly: 2, monthly: 3, annually: 4 }
Problem:
Describe: Updating entities through rails_admin
Contexts:
It is wrongly updating the enum to the first possible value instead of letting it stay empty/null
There where some improvements on the way rails_admin deals with enum recently, and all seen good, but they generated this bug where it is updating enum values when is not wanted.
Rails version: 5.0.6
Ruby version 2.5.0