Class: Users::CreateService
- Inherits:
-
BaseService
- Object
- BaseService
- Users::CreateService
- Includes:
- NewUserNotifier
- Defined in:
- app/services/users/create_service.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user, params = {}) ⇒ CreateService
constructor
A new instance of CreateService.
Methods included from NewUserNotifier
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 = {}) ⇒ CreateService
Returns a new instance of CreateService.
7 8 9 10 |
# File 'app/services/users/create_service.rb', line 7 def initialize(current_user, params = {}) @current_user = current_user @params = params.dup end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/services/users/create_service.rb', line 12 def execute user = build_class.new(current_user, params).execute reset_token = user.generate_reset_token if user.recently_sent_password_reset? after_create_hook(user, reset_token) if user.save user end |