feat: 上位タグのバグ修正(#174) (#175)

#174 エラー回避と誤記修正

#174 完了

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #175
This commit was merged in pull request #175.
This commit is contained in:
2025-12-10 20:18:48 +09:00
parent d50a302d26
commit 3b32d4d8ac
4 changed files with 33 additions and 3 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ class TagImplication < ApplicationRecord
belongs_to :tag, class_name: 'Tag'
belongs_to :parent_tag, class_name: 'Tag'
validates :tag_id, presence: true
validates :tag_id, presence: true, uniqueness: { scope: :parent_tag_id }
validates :parent_tag_id, presence: true
validate :parent_tag_mustnt_be_itself