Do not allow adding votes to expired polls (#10214)
* Do not allow adding votes to expired polls * Only validate expires_at on create
This commit is contained in:
@ -11,6 +11,8 @@ class VoteService < BaseService
|
||||
@choices = choices
|
||||
@votes = []
|
||||
|
||||
return if @poll.expired?
|
||||
|
||||
ApplicationRecord.transaction do
|
||||
@choices.each do |choice|
|
||||
@votes << @poll.votes.create!(account: @account, choice: choice)
|
||||
|
Reference in New Issue
Block a user