* Make sure the poll is created before storing its id
* Fix updating poll results
* Support fetching Question activities from the search bar
before_validation :set_conversation
before_validation :set_local
- before_save :set_poll_id
+ after_create :set_poll_id
class << self
def selectable_visibilities
end
def set_poll_id
- self.poll_id = owned_poll.id unless owned_poll.nil?
+ update_column(:poll_id, owned_poll.id) unless owned_poll.nil?
end
def set_visibility
end
def expected_type?
- equals_or_includes_any?(@json['type'], 'Question')
+ equals_or_includes_any?(@json['type'], %w(Question))
end
end
def process_url
if equals_or_includes_any?(type, %w(Application Group Organization Person Service))
FetchRemoteAccountService.new.call(atom_url, body, protocol)
- elsif equals_or_includes_any?(type, %w(Note Article Image Video Page))
+ elsif equals_or_includes_any?(type, %w(Note Article Image Video Page Question))
FetchRemoteStatusService.new.call(atom_url, body, protocol)
end
end