diff options
author | ThibG <thib@sitedethib.com> | 2019-03-08 00:54:50 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-08 00:54:50 +0100 |
commit | 3aaac4f134eb092baeb0ba5979bdb3abd702a4ee (patch) | |
tree | 166112abcd990ece652d0be5792be5d54edd58cc /app/models | |
parent | 054bbb3da21b2c76374eb921cba862adb8d5a0b3 (diff) |
Do not allow adding votes to expired polls (#10214)
* Do not allow adding votes to expired polls * Only validate expires_at on create
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/poll.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/poll.rb b/app/models/poll.rb index 14a38026a..09f0b65ec 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -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) } |