Resolve "Align Team add_X methods with add_user"
What does this MR do?
Closes #261970 (closed)
The #add_X
methods such as #add_developer
are just a friendly shortcut to calling #add_user
with the specified role. However, #add_user
params have moved beyond what the #add_X
methods pass through. This MR will align the params.
I have also made a DRY refactor and placed the #add_X
methods from both ProjectTeam
and Group
models in to a concern. The method signatures we're not quite the same in these models:
ProjectTeam
def add_guest(user, current_user: nil)
Group
def add_guest(user, current_user = nil)
Fortunately these signatures can be made compatible:
def add_guest(user, current_user = nil, **params)
params[:current_user] ||= current_user
add_user(user, role, params)
end
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Alex Pooley