Class: IncidentManagement::LinkAlerts::DestroyService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseProjectService
- BaseService
- IncidentManagement::LinkAlerts::DestroyService
- Defined in:
- app/services/incident_management/link_alerts/destroy_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) ⇒ DestroyService
constructor
A new instance of DestroyService.
Methods inherited from BaseContainerService
#group_container?, #namespace_container?, #project_container?, #project_group
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) ⇒ DestroyService
Returns a new instance of DestroyService.
9 10 11 12 13 14 15 |
# File 'app/services/incident_management/link_alerts/destroy_service.rb', line 9 def initialize(incident, current_user, alert) @incident = incident @current_user = current_user @alert = alert super(project: incident.project, current_user: current_user) end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/services/incident_management/link_alerts/destroy_service.rb', line 17 def execute return unless allowed? incident.alert_management_alerts.delete(alert) success end |