Class: IssuableLinks::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- IssuableLinks::DestroyService
- Defined in:
- app/services/issuable_links/destroy_service.rb
Direct Known Subclasses
IssueLinks::DestroyService, WorkItems::ParentLinks::DestroyService
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Attributes inherited from BaseService
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(link, user) ⇒ DestroyService
constructor
A new instance of DestroyService.
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(link, user) ⇒ DestroyService
Returns a new instance of DestroyService.
7 8 9 10 11 12 |
# File 'app/services/issuable_links/destroy_service.rb', line 7 def initialize(link, user) @link = link @current_user = user @source = link.source @target = link.target end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
5 6 7 |
# File 'app/services/issuable_links/destroy_service.rb', line 5 def current_user @current_user end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
5 6 7 |
# File 'app/services/issuable_links/destroy_service.rb', line 5 def link @link end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'app/services/issuable_links/destroy_service.rb', line 5 def source @source end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
5 6 7 |
# File 'app/services/issuable_links/destroy_service.rb', line 5 def target @target end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/services/issuable_links/destroy_service.rb', line 14 def execute return error(, 404) unless remove_relation after_destroy success(message: 'Relation was removed') end |