Class: Issuable::DestroyService
- Inherits:
-
IssuableBaseService
- Object
- BaseContainerService
- IssuableBaseService
- Issuable::DestroyService
- Defined in:
- app/services/issuable/destroy_service.rb
Direct Known Subclasses
Constant Summary collapse
- BATCH_SIZE =
100
Instance Attribute Summary
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
- #execute(issuable) ⇒ Object
-
#initialize(container:, current_user: nil, params: {}) ⇒ DestroyService
constructor
TODO: this is to be removed once we get to rename the IssuableBaseService project param to container.
Methods inherited from IssuableBaseService
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(container:, current_user: nil, params: {}) ⇒ DestroyService
TODO: this is to be removed once we get to rename the IssuableBaseService project param to container
8 9 10 |
# File 'app/services/issuable/destroy_service.rb', line 8 def initialize(container:, current_user: nil, params: {}) super(container: container, current_user: current_user, params: params) end |
Instance Method Details
#execute(issuable) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/services/issuable/destroy_service.rb', line 12 def execute(issuable) # load sync object before destroy otherwise we cannot access it for # deletion of label links in delete_label_links @synced_object_to_delete = issuable.try(:sync_object) before_destroy(issuable) destroy_ci_records(issuable) after_destroy(issuable) if issuable.destroy end |