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

View File

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

View File

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