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
ideally, AS would do some magic, spot that this is an enum, and provide the update field as a select with the enum symbol values. Failing that, if I had to tell rails that the column was an enum to trigger the same behaviour- that would be the next best thing.
thanks for a fantastic project.
The text was updated successfully, but these errors were encountered:
to be fair - I get confused with rails enums as well...
In my model, I have the following enum:
`enum message_type: { unspecified: 0, activity: 10, personal: 50, announcement: 70, nothing: 100 }``
in the database, this column is a simple integer
t.integer :message_type, null: false, default: 0
Active scaffold correctly shows me the symbol in the 'show' column (e.g. if the db has 10, it shows me 'activity')
However, in the edit column, it gives me a numeric field which is incorrectly pre filled with text instead of the number.
ideally, AS would do some magic, spot that this is an enum, and provide the update field as a select with the enum symbol values. Failing that, if I had to tell rails that the column was an enum to trigger the same behaviour- that would be the next best thing.
thanks for a fantastic project.
The text was updated successfully, but these errors were encountered: