このコミットが含まれているのは:
2026-06-21 15:02:13 +09:00
コミット 8eb8fb355b
17個のファイルの変更210行の追加37行の削除
+9
ファイルの表示
@@ -58,6 +58,7 @@ class Tag < ApplicationRecord
validate :nico_tag_name_must_start_with_nico
validate :tag_name_must_be_canonical
validate :category_must_be_deerjikist_with_deerjikists
validate :nico_tags_cannot_be_deprecated
scope :nico_tags, -> { nico }
@@ -77,6 +78,8 @@ class Tag < ApplicationRecord
(self.tag_name ||= build_tag_name).name = val
end
def deprecated? = deprecated_at?
def has_wiki = wiki_page.present?
def material_id = materials.first&.id
@@ -228,4 +231,10 @@ class Tag < ApplicationRecord
errors.add :category, 'ニジラーと紐づいてゐるタグはニジラー・カテゴリである必要があります.'
end
end
def nico_tags_cannot_be_deprecated
if nico? && deprecated_at.present?
errors.add :deprecated_at, 'ニコタグは廃止できません.'
end
end
end