Class: WikiPages::DestroyService
Instance Attribute Summary
#container, #current_user, #group, #params, #project
Instance Method Summary
collapse
#group_container?, #initialize, #namespace_container?, #project_container?, #project_group
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
#can?
Instance Method Details
#event_action ⇒ Object
24
25
26
|
# File 'app/services/wiki_pages/destroy_service.rb', line 24
def event_action
:destroyed
end
|
#execute(page) ⇒ Object
5
6
7
8
9
10
11
12
13
14
|
# File 'app/services/wiki_pages/destroy_service.rb', line 5
def execute(page)
if page.delete
execute_hooks(page)
ServiceResponse.success(payload: { page: page })
else
ServiceResponse.error(
message: _('Could not delete wiki page'), payload: { page: page }
)
end
end
|
#external_action ⇒ Object
20
21
22
|
# File 'app/services/wiki_pages/destroy_service.rb', line 20
def external_action
'delete'
end
|
#fingerprint(page) ⇒ Object
28
29
30
|
# File 'app/services/wiki_pages/destroy_service.rb', line 28
def fingerprint(page)
page.wiki.repository.head_commit.sha
end
|
#usage_counter_action ⇒ Object
16
17
18
|
# File 'app/services/wiki_pages/destroy_service.rb', line 16
def usage_counter_action
:delete
end
|