Class: CustomerRelations::Contacts::CreateService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseGroupService
- BaseService
- CustomerRelations::Contacts::CreateService
- Defined in:
- app/services/customer_relations/contacts/create_service.rb
Instance Attribute Summary
Attributes inherited from BaseGroupService
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
Methods inherited from BaseGroupService
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 BaseGroupService
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/services/customer_relations/contacts/create_service.rb', line 6 def execute return unless allowed? return error_organization_invalid unless organization_valid? contact = Contact.create(params.merge(group_id: group.id)) return error_creating(contact) unless contact.persisted? ServiceResponse.success(payload: contact) end |