updated seeds file

This commit is contained in:
Mark Moser 2016-08-25 19:10:58 -05:00
parent 24c61482fe
commit 8269bb9e5c
3 changed files with 11 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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'
)