2016-11-17 22:43:19 -06:00
|
|
|
# frozen_string_literal: true
|
|
|
|
class ReviewerVote < ApplicationRecord
|
|
|
|
belongs_to :candidate
|
|
|
|
belongs_to :user
|
|
|
|
|
2016-11-18 17:43:24 -06:00
|
|
|
validates :user_id, uniqueness: { scope: :candidate_id }
|
|
|
|
|
2016-11-17 22:43:19 -06:00
|
|
|
enum vote: {
|
|
|
|
undecided: 0,
|
|
|
|
yea: 1,
|
|
|
|
nay: 2
|
|
|
|
}
|
|
|
|
|
|
|
|
enum veto: {
|
|
|
|
approved: 1,
|
|
|
|
rejected: 2
|
|
|
|
}
|
|
|
|
end
|