diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-05-26 00:20:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-26 00:20:30 +0200 |
commit | 25dda3061e4308a5005d3a2fef373acffc510a66 (patch) | |
tree | 19d9ee8b5130994fea8e12d3d3bef3c989f64aa8 /app | |
parent | 96f29ce91ad622a0127bc3c3bf2dc503062ed0dc (diff) |
Fix unnecessary query on status creation (#17901)
Diffstat (limited to 'app')
-rw-r--r-- | app/models/status.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index a4e685ce3..4828d6340 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 |