Class: Metrics::UsersStarredDashboards::DeleteService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/metrics/users_starred_dashboards/delete_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params

Instance Method Summary collapse

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

#can?

Constructor Details

#initialize(user, project, dashboard_path = nil) ⇒ DeleteService

Returns a new instance of DeleteService.


7
8
9
10
11
# File 'app/services/metrics/users_starred_dashboards/delete_service.rb', line 7

def initialize(user, project, dashboard_path = nil)
  @user = user
  @project = project
  @dashboard_path = dashboard_path
end

Instance Method Details

#executeObject


13
14
15
# File 'app/services/metrics/users_starred_dashboards/delete_service.rb', line 13

def execute
  ServiceResponse.success(payload: { deleted_rows: starred_dashboards.delete_all })
end