|
|
@@ -67,6 +67,14 @@ class Tag < ApplicationRecord |
|
|
@bot ||= find_or_create_by_tag_name!('bot操作', category: :meta) |
|
|
@bot ||= find_or_create_by_tag_name!('bot操作', category: :meta) |
|
|
end |
|
|
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 |
|
|
def self.normalise_tags tag_names, with_tagme: true, deny_nico: true |
|
|
if deny_nico && tag_names.any? { |n| n.start_with?('nico:') } |
|
|
if deny_nico && tag_names.any? { |n| n.start_with?('nico:') } |
|
|
raise NicoTagNormalisationError |
|
|
raise NicoTagNormalisationError |
|
|
|