changed enum to string in user and job model

This commit is contained in:
2024-09-07 23:24:07 +02:00
parent fc26bdc3ac
commit ba4331c252
6 changed files with 14 additions and 13 deletions

View File

@@ -22,9 +22,9 @@ class User < ApplicationRecord
normalizes :email, with: -> { _1.strip.downcase }
enum :role, {
user: 0,
operator: 1,
admin: 2
user: "user",
operator: "operator",
admin: "admin"
}
before_validation if: :email_changed?, on: :update do