codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
385 stars 69 forks source link

Skip min title validation for help/policy posts #1197

Closed Taeir closed 10 months ago

Taeir commented 1 year ago

Seeding was no longer creating help/policy posts with title lengths < 15, due to the recent validations changes. This PR excludes help and policy documents from the min title length requirement, to allow help articles like "FAQ" to be created again.

Taeir commented 10 months ago

Changes LGTM (I personally prefer ternary expressions, but my background mostly includes languages where you can't assign the result of evaluating the if...else directly anyway; as it passes rubocop, all good)

@Oaphi I was thinking about the options, but since we have 3 cases here ternary expressions seemed a bit much, and this if-else-end expression is what I had to do to make rubocop happy, so yeah 😅