Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #1629
Closed
Open
Issue created Apr 29, 2020 by Administrator@rootContributor

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

Assignee
Assign to
Time tracking