post_tags の論理削除と履歴管理を廃止 (#411) (#417)

Reviewed-on: #417
Co-authored-by: miteruzo <miteruzo@naver.com>
このコミットはプルリクエスト #417 でマージされました。
このコミットが含まれているのは:
2026-09-21 06:02:41 +09:00
committed by みてるぞ
コミット 7f0efc3a46
18個のファイルの変更388行の追加286行の削除
+3 -3
ファイルの表示
@@ -103,7 +103,7 @@ module Youtube
end
def sync_post_tags! post, desired_tag_ids, current_tag_ids: nil
current_tag_ids ||= PostTag.kept.where(post_id: post.id).pluck(:tag_id).to_set
current_tag_ids ||= PostTag.where(post_id: post.id).pluck(:tag_id).to_set
desired_tag_ids = desired_tag_ids.compact.to_set
to_add = desired_tag_ids - current_tag_ids
@@ -117,8 +117,8 @@ module Youtube
end
end
PostTag.where(post_id: post.id, tag_id: to_remove.to_a).kept.find_each do |pt|
pt.discard_by!(nil)
PostTag.where(post_id: post.id, tag_id: to_remove.to_a).find_each do |pt|
pt.destroy!
end
end