タグ履歴 (#309) (#319)

#309

#309

#309

#309

#309

Merge remote-tracking branch 'origin/main' into feature/309

#309

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #319
This commit was merged in pull request #319.
This commit is contained in:
2026-04-19 20:21:51 +09:00
parent 5c7580d571
commit bde7d33949
27 changed files with 923 additions and 123 deletions
+5
View File
@@ -115,6 +115,10 @@ namespace :nico do
datum['tags'].each do |raw|
name = TagNameSanitisationRule.sanitise("nico:#{ raw }")
tag = Tag.find_or_create_by_tag_name!(name, category: :nico)
event_type = tag.nico_tag_versions.exists? ? :update : :create
NicoTagVersionRecorder.record!(tag:, event_type:, created_by_user: nil)
desired_nico_tag_based_ids << tag.id
# 新たに記載される外部タグと連携される内部タグを記載
@@ -149,6 +153,7 @@ namespace :nico do
if post_created
PostVersionRecorder.record!(post:, event_type: :create, created_by_user: nil)
elsif post_changed || kept_tag_ids != desired_all_tag_ids.to_set
PostVersionRecorder.ensure_snapshot!(post, created_by_user: nil)
PostVersionRecorder.record!(post:, event_type: :update, created_by_user: nil)
end
end