Reproduction steps:
- Create a new category
- In the tags setting, notice that the minimal number of tags is empty
- Click in, and click out. (I happened to do this by mistake)
- Try to submit the project : 500 error.
Log:
Failed to handle exception in exception app middleware : ActiveRecord::NotNullViolation : PG::NotNullViolation: ERROR: null value in column "minimum_required_tags" of relation "categories" violates not-null constraint
DETAIL: Failing row contains (110, BON Development, 231F20, null, 0, 2024-03-07 14:38:58.055217, 2024-03-07 14:38:58.055217, 12, 0, 0, 0, bon-development, null, FFFFFF, t, null, 0, null, null, 106, null, 0, 0, 0, null, f, 0, 0, t, bon development, f, null, null, null, null, null, null, t, f, f, 3, null, rows_with_featured_topics, all, f, null, f, 0, f, null, null, all, f, null, null, null).
Expectation, two options:
A: Field should default to 0, whether we click on it or not.
B: The error message should clearly point to the problematic field.
The logs saved the day, because I could see the problematic field and put a 0 in it. But only admins have access to the logs!
Thanks!