Browse Source

#282

feature/282
みてるぞ 2 weeks ago
parent
commit
696e4a0098
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      backend/app/models/tag.rb

+ 1
- 1
backend/app/models/tag.rb View File

@@ -153,7 +153,7 @@ class Tag < ApplicationRecord
if PostTag.kept.exists?(post_id: pt.post_id, tag_id: target_tag.id)
pt.discard_by!(nil)
# discard 後の update! は禁止なので DB を直に更新
pt.update_columns(tag_id: target_tag.id)
pt.update_columns(tag_id: target_tag.id, updated_at: Time.current)
else
pt.update!(tag: target_tag)
end


Loading…
Cancel
Save