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 :questions, -> { order(:sort) }
|
||||||
has_many :candidates
|
has_many :candidates
|
||||||
|
|
||||||
validates_presence_of :name
|
validates :name, presence: true, uniqueness: true
|
||||||
validates_presence_of :dept
|
validates :dept, presence: true
|
||||||
validates_presence_of :unit
|
validates :unit, presence: true
|
||||||
end
|
end
|
||||||
|
@ -2,9 +2,9 @@ class User < ApplicationRecord
|
|||||||
has_secure_password
|
has_secure_password
|
||||||
has_many :candidates, foreign_key: "recruiter_id"
|
has_many :candidates, foreign_key: "recruiter_id"
|
||||||
|
|
||||||
validates_presence_of :email
|
validates :email, presence: true, uniqueness: true
|
||||||
validates_presence_of :name
|
validates :name, presence: true
|
||||||
validates_presence_of :role
|
validates :role, presence: true
|
||||||
validates :reset_token, uniqueness: true, allow_nil: true
|
validates :reset_token, uniqueness: true, allow_nil: true
|
||||||
|
|
||||||
def setup_reset
|
def setup_reset
|
||||||
|
@ -13,4 +13,8 @@ User.create(
|
|||||||
role: 'admin'
|
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