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