From 118cce2f8f60aa3d2990d2f86be6a02683c433fd Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 17 Oct 2017 23:13:21 +0200 Subject: [PATCH] Add letter origin back to poll voters --- app/models/poll/voter.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/poll/voter.rb b/app/models/poll/voter.rb index 522c28de2..c899cabc9 100644 --- a/app/models/poll/voter.rb +++ b/app/models/poll/voter.rb @@ -1,7 +1,7 @@ class Poll class Voter < ApplicationRecord - VALID_ORIGINS = %w{web booth}.freeze + VALID_ORIGINS = %w[web booth letter].freeze belongs_to :poll belongs_to :user @@ -20,8 +20,9 @@ class Poll before_validation :set_demographic_info, :set_document_info, :set_denormalized_booth_assignment_id - scope :web, -> { where(origin: "web") } - scope :booth, -> { where(origin: "booth") } + scope :web, -> { where(origin: "web") } + scope :booth, -> { where(origin: "booth") } + scope :letter, -> { where(origin: "letter") } def set_demographic_info return if user.blank?