Class: Users::SignupService
- Inherits:
-
BaseService
- Object
- BaseService
- Users::SignupService
- Defined in:
- app/services/users/signup_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user, params = {}) ⇒ SignupService
constructor
A new instance of SignupService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(current_user, params = {}) ⇒ SignupService
Returns a new instance of SignupService.
5 6 7 8 |
# File 'app/services/users/signup_service.rb', line 5 def initialize(current_user, params = {}) @user = current_user @params = params.dup end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/services/users/signup_service.rb', line 10 def execute assign_attributes inject_validators if @user.save ServiceResponse.success else ServiceResponse.error(message: @user.errors..join('. ')) end end |