Enum fields should be generated as Field::Select instead of Field::String
Created by: betelgeuse
- What were you trying to do? Run generator for a ActiveRecord model with an enum column.
- What did you end up with (logs, or, even better, example apps are great!)? Dashboard with Field::String
- What versions are you running?
- Rails: 6.0
- administrate: master
The generated field should be like this
enum_attribute: Field::Select.with_options(collection: Model.enum_attributes.keys)
With Field::String submitting to the update action with invalid value results in a Server Error of ArgumentError in Admin::ModelController#update