Class: Decidim::Admin::DestroyOAuthApplication

Inherits:
Rectify::Command
  • Object
show all
Defined in:
app/commands/decidim/admin/destroy_oauth_application.rb

Overview

This command deals with destroying an application from the admin panel.

Instance Method Summary collapse

Constructor Details

#initialize(application, current_user) ⇒ DestroyOAuthApplication

Public: Initializes the command.

application - The OAuthApplication to be destroyed. user - The user that destroys the application.



11
12
13
14
# File 'app/commands/decidim/admin/destroy_oauth_application.rb', line 11

def initialize(application, current_user)
  @application = application
  @current_user = current_user
end

Instance Method Details

#callObject

Public: Executes the command.

Broadcasts :ok if it got destroyed



19
20
21
22
# File 'app/commands/decidim/admin/destroy_oauth_application.rb', line 19

def call
  destroy_application
  broadcast(:ok)
end