adds scopes for final/voting_days officer_assignments

This commit is contained in:
Juanjo Bazán
2017-01-30 11:51:19 +01:00
parent e85a227477
commit 2859975e81
2 changed files with 7 additions and 3 deletions

View File

@@ -10,5 +10,8 @@ class Poll
validates :date, presence: true, uniqueness: { scope: [:officer_id, :booth_assignment_id] }
delegate :poll_id, :booth_id, to: :booth_assignment
scope :voting_days, -> { where(final: false) }
scope :final, -> { where(final: true) }
end
end