Make sure the poll is created before storing its id (#10142)
* Make sure the poll is created before storing its id * Fix updating poll results * Support fetching Question activities from the search bar
This commit is contained in:
@ -255,7 +255,7 @@ class Status < ApplicationRecord
|
||||
before_validation :set_conversation
|
||||
before_validation :set_local
|
||||
|
||||
before_save :set_poll_id
|
||||
after_create :set_poll_id
|
||||
|
||||
class << self
|
||||
def selectable_visibilities
|
||||
@ -446,7 +446,7 @@ class Status < ApplicationRecord
|
||||
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
|
||||
|
Reference in New Issue
Block a user