ニコタグ連携バグ修正 (#294) (#316)

#294

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #316
このコミットはPull リクエスト #316 でマージされました.
このコミットが含まれているのは:
2026-04-19 16:44:20 +09:00
コミット 5c7580d571
2個のファイルの変更6行の追加3行の削除
+4 -2
ファイルの表示
@@ -98,7 +98,9 @@ class Tag < ApplicationRecord
@niconico ||= find_or_create_by_tag_name!('ニコニコ', category: :meta)
end
def self.normalise_tags tag_names, with_tagme: true, deny_nico: true
def self.normalise_tags tag_names, with_tagme: true,
with_no_deerjikist: true,
deny_nico: true
if deny_nico && tag_names.any? { |n| n.downcase.start_with?('nico:') }
raise NicoTagNormalisationError
end
@@ -112,7 +114,7 @@ class Tag < ApplicationRecord
end
tags << Tag.tagme if with_tagme && tags.size < 10 && tags.none?(Tag.tagme)
tags << Tag.no_deerjikist if tags.all? { |t| !(t.deerjikist?) }
tags << Tag.no_deerjikist if with_no_deerjikist && tags.all? { |t| !(t.deerjikist?) }
tags.uniq(&:id)
end