Class: Achievements::CreateService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseService
- Achievements::CreateService
- Defined in:
- app/services/achievements/create_service.rb
Instance Attribute Summary
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
Methods inherited from BaseService
Methods inherited from BaseContainerService
#group_container?, #initialize, #namespace_container?, #project_container?, #project_group, #root_ancestor
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
This class inherits a constructor from Achievements::BaseService
Instance Method Details
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/services/achievements/create_service.rb', line 5 def execute return unless allowed? achievement = Achievements::Achievement.create(params.merge(namespace_id: @namespace.id)) return error_creating(achievement) unless achievement.persisted? ServiceResponse.success(payload: achievement) end |