From 7dd83a12e27663a72631725d9cd552be1aa51273 Mon Sep 17 00:00:00 2001 From: nonamethanks Date: Thu, 11 Mar 2021 17:51:16 +0100 Subject: [PATCH] BURs: don't check for category when implicating empty tags The default category for empty tags is general, so implications are otherwise always going to be rejected when the tag is created via BUR beforehand. Ref: https://danbooru.donmai.us/forum_topics/18013?page=2#forum_post_182107 --- app/models/tag_implication.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/tag_implication.rb b/app/models/tag_implication.rb index c0bf11992..f84ba53fb 100644 --- a/app/models/tag_implication.rb +++ b/app/models/tag_implication.rb @@ -99,7 +99,10 @@ class TagImplication < TagRelationship end end + # Require tags to have the same category. Doesn't apply when either tag is empty, + # because they could have been populated from a previous update script. def tag_categories_are_compatible + return if antecedent_tag.empty? || consequent_tag.empty? if antecedent_tag.category != consequent_tag.category errors.add(:base, "Can't imply a #{antecedent_tag.category_name.downcase} tag to a #{consequent_tag.category_name.downcase} tag") end