Fix unnecessary query on status creation (#17901)

This commit is contained in:
Claire authored and GitHub committed 2022-05-26 00:20:30 +02:00
1 parent 96f29ce91a
commit 25dda3061e
1 file changed
+1 -1
+1 -1
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