From 800fa1786cb1ce45af50ff258d0099af3ee003d7 Mon Sep 17 00:00:00 2001 From: Benjamin Neff <benjamin@coding4coffee.ch> Date: Sun, 27 Mar 2016 17:22:42 +0200 Subject: [PATCH] fix author join for federation callbacks with Poll --- app/models/poll.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index cf6f0f452a..da9180a6f5 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -5,12 +5,13 @@ class Poll < ActiveRecord::Base belongs_to :status_message has_many :poll_answers, -> { order 'id ASC' } has_many :poll_participations + has_one :author, through: :status_message xml_attr :question xml_attr :poll_answers, :as => [PollAnswer] #forward some requests to status message, because a poll is just attached to a status message and is not sharable itself - delegate :author, :author_id, :diaspora_handle, :public?, :subscribers, to: :status_message + delegate :author_id, :diaspora_handle, :public?, :subscribers, to: :status_message validate :enough_poll_answers validates :question, presence: true -- GitLab