aboutsummaryrefslogtreecommitdiff
path: root/app/models/poll.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/poll.rb')
-rw-r--r--app/models/poll.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/poll.rb b/app/models/poll.rb
index b5deafcc2..d2a17277b 100644
--- a/app/models/poll.rb
+++ b/app/models/poll.rb
@@ -25,7 +25,7 @@ class Poll < ApplicationRecord
belongs_to :account
belongs_to :status
- has_many :votes, class_name: 'PollVote', inverse_of: :poll, dependent: :destroy
+ has_many :votes, class_name: 'PollVote', inverse_of: :poll, dependent: :delete_all
has_many :notifications, as: :activity, dependent: :destroy
@@ -73,10 +73,12 @@ class Poll < ApplicationRecord
attributes :id, :title, :votes_count, :poll
def initialize(poll, id, title, votes_count)
- @poll = poll
- @id = id
- @title = title
- @votes_count = votes_count
+ super(
+ poll: poll,
+ id: id,
+ title: title,
+ votes_count: votes_count,
+ )
end
end