Resolve "Does not set `projects_limit` to 10 when creating user via API"
What does this MR do?
- Removes default value from users.projects_limit
- Adds NOT NULL constraint to users.projects_limit
- Simplifies the
set_projects_limit
after_initialize callback in theUser
model
Are there points in the code the reviewer needs to double check?
I added the original issue as a test in user_spec
, but I'm not sure if it should be added at all (line 819)
Why was this MR needed?
See #31995 (closed)
Without these changes, a new User cannot be created with a projects_limit
value that matches the DB default because it will be overridden with the current_application_settings.default_projects_limit
because ActiveRecord's *_changed?
methods return false if the value being set matches the DB default.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered
What are the relevant issue numbers?
Closes #31995 (closed)
Edited by Dmytro Zaporozhets (DZ)