Fix unnecessary query on status creation (#17901)

th-downstream
Claire 2 years ago committed by GitHub
parent c5f0792a0d
commit e220fcf1d4

@ -454,7 +454,7 @@ class Status < ApplicationRecord
end end
def set_poll_id 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 end
def set_visibility def set_visibility

Loading…
Cancel
Save