Skip to content
Extraits de code Groupes Projets
Valider 800fa178 rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

fix author join for federation callbacks with Poll

parent 374915b4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -5,12 +5,13 @@ class Poll < ActiveRecord::Base ...@@ -5,12 +5,13 @@ class Poll < ActiveRecord::Base
belongs_to :status_message belongs_to :status_message
has_many :poll_answers, -> { order 'id ASC' } has_many :poll_answers, -> { order 'id ASC' }
has_many :poll_participations has_many :poll_participations
has_one :author, through: :status_message
xml_attr :question xml_attr :question
xml_attr :poll_answers, :as => [PollAnswer] 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 #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 validate :enough_poll_answers
validates :question, presence: true validates :question, presence: true
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter