From 65d9004ac90209a035e2f103e271986ff8650410 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 13 Mar 2019 19:29:54 +0100 Subject: Add UI for enabling/disabling poll notifications (#10255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add UI for enabling/disabling poll notifications * Add poll notifications to the (advanced) quick filter bar * Update poll notification message “Your poll has ended” → “A poll you have voted in has ended” * Clear up associated notifications when a poll is deleted --- app/models/poll.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models/poll.rb') diff --git a/app/models/poll.rb b/app/models/poll.rb index 09f0b65ec..6df230337 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -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? -- cgit