Fix unnecessary query on status creation (#17901)

lolsob-rspec
Claire 2022-05-26 00:20:30 +02:00 committed by GitHub
parent c5f0792a0d
commit e220fcf1d4
1 changed files with 1 additions and 1 deletions

View File

@ -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