changed enum to string in user and job model
This commit is contained in:
@@ -27,11 +27,11 @@ class Job < ApplicationRecord
|
||||
|
||||
# NOTE: Multiple status if paing before brinting?
|
||||
enum :status, {
|
||||
open: 0,
|
||||
printing: 1,
|
||||
pickup: 2,
|
||||
paid: 3,
|
||||
canceled: 4
|
||||
open: "open",
|
||||
printing: "printing",
|
||||
pickup: "pickup",
|
||||
paid: "paid",
|
||||
canceled: "canceled"
|
||||
}
|
||||
|
||||
AVAILABLE_PAGE_FORMATS = [ :a0, :a1, :a2, :a3 ]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user