#106 ニジラー情報なし

このコミットが含まれているのは:
2025-09-07 19:21:33 +09:00
コミット 9f10bc8467
2個のファイルの変更8行の追加0行の削除
+7
ファイルの表示
@@ -46,6 +46,12 @@ class Tag < ApplicationRecord
end
end
def self.no_deerjikist
@no_deerjikist ||= Tag.find_or_initialize_by(name: 'ニジラー情報なし') do |tag|
tag.category = 'meta'
end
end
def self.normalise_tags tag_names, with_tagme: true
tags = tag_names.map do |name|
pf, cat = CATEGORY_PREFIXES.find { |p, _| name.start_with?(p) } || ['', nil]
@@ -58,6 +64,7 @@ class Tag < ApplicationRecord
end
end
tags << Tag.tagme if with_tagme && tags.size < 20 && tags.none?(Tag.tagme)
tags << Tag.no_deerjikist if tags.all? { |t| t.category != 'deerjika' }
tags.uniq
end
+1
ファイルの表示
@@ -53,6 +53,7 @@ namespace :nico do
end
tags_to_add << Tag.tagme if post.tags.size < 20
tags_to_add << Tag.bot
tags_to_add << Tag.no_deerjikist if post.tags.all? { |t| t.category != 'deerjikist' }
post.tags = (post.tags + tags_to_add).uniq
end
end