diff options
-rw-r--r-- | app/models/user_account.rb | 1 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/models/user_account.rb b/app/models/user_account.rb index d9d67a4..ceb8334 100644 --- a/app/models/user_account.rb +++ b/app/models/user_account.rb @@ -11,6 +11,7 @@ class UserAccount < ApplicationRecord validates :email, presence: true validates :first_name, presence: true validates :last_name, presence: true + validates :role, presence: true, inclusion: { in: %w[master regular] } def full_name "#{first_name} #{last_name}" diff --git a/db/schema.rb b/db/schema.rb index 6948e6b..afe279a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_02_22_010138) do +ActiveRecord::Schema[7.0].define(version: 2023_02_22_012901) do create_table "user_accounts", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t| t.string "email" t.string "password_digest" @@ -19,6 +19,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_22_010138) do t.string "session_key" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "role" end end |