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:
@ -28,7 +28,7 @@ class Poll < ApplicationRecord
|
||||
|
||||
validates :options, presence: true
|
||||
validates :expires_at, presence: true, if: :local?
|
||||
validates_with PollValidator, if: :local?
|
||||
validates_with PollValidator, on: :create, if: :local?
|
||||
|
||||
scope :attached, -> { where.not(status_id: nil) }
|
||||
scope :unattached, -> { where(status_id: nil) }
|
||||
|
Reference in New Issue
Block a user