updated seeds file
This commit is contained in:
parent
24c61482fe
commit
8269bb9e5c
@ -2,7 +2,7 @@ class Quiz < ApplicationRecord
|
||||
has_many :questions, -> { order(:sort) }
|
||||
has_many :candidates
|
||||
|
||||
validates_presence_of :name
|
||||
validates_presence_of :dept
|
||||
validates_presence_of :unit
|
||||
validates :name, presence: true, uniqueness: true
|
||||
validates :dept, presence: true
|
||||
validates :unit, presence: true
|
||||
end
|
||||
|
@ -2,9 +2,9 @@ class User < ApplicationRecord
|
||||
has_secure_password
|
||||
has_many :candidates, foreign_key: "recruiter_id"
|
||||
|
||||
validates_presence_of :email
|
||||
validates_presence_of :name
|
||||
validates_presence_of :role
|
||||
validates :email, presence: true, uniqueness: true
|
||||
validates :name, presence: true
|
||||
validates :role, presence: true
|
||||
validates :reset_token, uniqueness: true, allow_nil: true
|
||||
|
||||
def setup_reset
|
||||
|
@ -13,4 +13,8 @@ User.create(
|
||||
role: 'admin'
|
||||
)
|
||||
|
||||
Quiz.create(unit: 'FED', dept: 'PDR')
|
||||
Quiz.create(
|
||||
name: 'PDR Standard FED Screening',
|
||||
unit: 'FED',
|
||||
dept: 'PDR'
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user