Merge branch 'master' into glitch-soc/merge-upstream

This commit is contained in:
Thibaut Girka
2019-03-13 21:35:43 +01:00
9 changed files with 129 additions and 23 deletions

View File

@@ -26,6 +26,8 @@ class Poll < ApplicationRecord
has_many :votes, class_name: 'PollVote', inverse_of: :poll, dependent: :destroy
has_many :notifications, as: :activity, dependent: :destroy
validates :options, presence: true
validates :expires_at, presence: true, if: :local?
validates_with PollValidator, on: :create, if: :local?