From 7e4c31b70cda233bc7e39ec6a7482055adab99d2 Mon Sep 17 00:00:00 2001
From: ArtOfCode- <hello@artofcode.co.uk>
Date: Tue, 19 May 2020 22:31:51 +0100
Subject: [PATCH] Require tags on questions only

---
 app/models/post.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/post.rb b/app/models/post.rb
index a61f1a30b..37d3d691d 100644
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -32,7 +32,7 @@ class Post < ApplicationRecord
   validate :stripped_minimum, if: :question?
   validate :category_allows_post_type
   validate :license_available
-  validate :required_tags?
+  validate :required_tags?, if: -> { post_type_id == Question.post_type_id }
 
   scope :undeleted, -> { where(deleted: false) }
   scope :deleted, -> { where(deleted: true) }
-- 
GitLab