diff --git a/app/models/status.rb b/app/models/status.rb index a4e685ce3ee..4828d63404b 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -454,7 +454,7 @@ class Status < ApplicationRecord end def set_poll_id - update_column(:poll_id, poll.id) unless poll.nil? + update_column(:poll_id, poll.id) if association(:poll).loaded? && poll.present? end def set_visibility