Class: IncidentManagement::LinkAlerts::CreateService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseProjectService
- BaseService
- IncidentManagement::LinkAlerts::CreateService
- Defined in:
- app/services/incident_management/link_alerts/create_service.rb
Instance Attribute Summary
Attributes inherited from BaseProjectService
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(incident, current_user, alert_references) ⇒ CreateService
constructor
A new instance of CreateService.
Methods inherited from BaseContainerService
#group_container?, #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
#initialize(incident, current_user, alert_references) ⇒ CreateService
Returns a new instance of CreateService.
12 13 14 15 16 17 18 |
# File 'app/services/incident_management/link_alerts/create_service.rb', line 12 def initialize(incident, current_user, alert_references) @incident = incident @current_user = current_user @alert_references = alert_references super(project: incident.project, current_user: current_user) end |
Instance Method Details
#execute ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/services/incident_management/link_alerts/create_service.rb', line 20 def execute return unless allowed? references = extract_alerts_from_references incident.alert_management_alerts << references if references.present? success end |