ニコニコ同期にて “ニコニコ” および “動画” を自動付与するやぅに(#156) (#251)

#156

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #251
This commit was merged in pull request #251.
This commit is contained in:
2026-01-31 15:00:56 +09:00
parent 5dd683bd4f
commit f3cd108b2e
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -67,9 +67,17 @@ class Tag < ApplicationRecord
@bot ||= find_or_create_by_tag_name!('bot操作', category: :meta)
end
def self.video
@video ||= find_or_create_by_tag_name!('動画', category: :meta)
end
def self.niconico
@niconico ||= find_or_create_by_tag_name!('ニコニコ', category: :meta)
end
def self.normalise_tags tag_names, with_tagme: true, deny_nico: true
if deny_nico && tag_names.any? { |n| n.start_with?('nico:') }
raise NicoTagNormalisationError
raise NicoTagNormalisationError
end
tags = tag_names.map do |name|