We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 051adf7 + 4c46487 commit 298b9c8Copy full SHA for 298b9c8
1 file changed
app/models/concerns/post_validations.rb
@@ -46,7 +46,14 @@ def stripped_minimum_body
46
end
47
48
def stripped_minimum_title
49
- min_title = category.nil? ? 15 : category.min_title_length
+ min_title = if ['HelpDoc', 'PolicyDoc'].include?(post_type.name)
50
+ 1
51
+ elsif category.nil?
52
+ 15
53
+ else
54
+ category.min_title_length
55
+ end
56
+
57
if (title&.gsub(/(?:^[\s\t\u2000-\u200F]+|[\s\t\u2000-\u200F]+$)/, '')&.length || 0) < min_title
58
errors.add(:title, "must be more than #{min_title} non-whitespace characters long")
59
0 commit comments