Merge branch 'master' into aperez-admin-question-videos
This commit is contained in:
@@ -2,6 +2,7 @@ class Poll
|
||||
class Officer < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
has_many :officer_assignments, class_name: "Poll::OfficerAssignment"
|
||||
has_many :shifts, class_name: "Poll::Shift"
|
||||
has_many :failed_census_calls, foreign_key: :poll_officer_id
|
||||
|
||||
validates :user_id, presence: true, uniqueness: true
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Poll::Question::Answer < ActiveRecord::Base
|
||||
include Galleryable
|
||||
|
||||
belongs_to :question, class_name: 'Poll::Question', foreign_key: 'question_id'
|
||||
has_many :videos, class_name: 'Poll::Question::Answer::Video'
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ class Poll
|
||||
|
||||
enum task: { vote_collection: 0, recount_scrutiny: 1 }
|
||||
|
||||
scope :vote_collection, -> { where(task: 'vote_collection') }
|
||||
scope :recount_scrutiny, -> { where(task: 'recount_scrutiny') }
|
||||
scope :current, -> { where(date: Date.current) }
|
||||
|
||||
before_create :persist_data
|
||||
after_create :create_officer_assignments
|
||||
before_destroy :destroy_officer_assignments
|
||||
|
||||
Reference in New Issue
Block a user