diff --git a/app/models/post.rb b/app/models/post.rb index 4c681d88395b3dc2578df1b14766c04ded831c22..6d5033ba2f8a74bdb710ff9758db19db5bfb938f 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -30,7 +30,7 @@ class Post < ApplicationRecord validate :stripped_minimum, if: :question? validate :category_allows_post_type validate :license_available - validate :has_required_tags + validate :required_tags? scope :undeleted, -> { where(deleted: false) } scope :deleted, -> { where(deleted: true) } @@ -232,7 +232,7 @@ class Post < ApplicationRecord end end - def has_required_tags + def required_tags? required = category&.required_tag_ids return unless required.present? && !required.empty?