外部タグの履歴管理方式を変更 (#445) (#480)

Co-authored-by: Codex Night Worker <codex-night@localhost>
Reviewed-on: #480
Co-authored-by: miteruzo <miteruzo@naver.com>
このコミットはプルリクエスト #480 でマージされました。
このコミットが含まれているのは:
2026-11-15 16:18:27 +09:00
committed by みてるぞ
co-authored by Codex Night Worker
コミット dda3d87073
27個のファイルの変更、3748行の追加、133行の削除
+1 -10
ファイルの表示
@@ -100,18 +100,9 @@ class PostVersionsController < ApplicationController
def external_tag_names_for snapshots
ids = snapshots.flatten.filter_map { _1['external_tag_id'] }.uniq
names = ExternalTag.where(id: ids).pluck(:id, :platform, :name).to_h { |id, platform, name|
ExternalTag.where(id: ids).pluck(:id, :platform, :name).to_h { |id, platform, name|
[id, "#{ platform }:#{ name }"]
}
missing_ids = ids - names.keys
HistoryAccess.visible(NicoTagVersion.all)
.where(tag_id: missing_ids)
.order(:tag_id, version_no: :desc)
.pluck(:tag_id, :name)
.each { |id, name| names[id] ||= name }
names
end
def snapshot_tag_literals snapshots, tag_names, external_tag_names