Sha256: de4a6d8ca2ddeb3c0c4d9c956c32ec7ce42b0a4861722e1a1bb5c35661d8dec9
Contents?: true
Size: 949 Bytes
Versions: 33
Compression:
Stored size: 949 Bytes
Contents
# frozen_string_literal: true module Decidim module System # This command deals with destroying an application from the admin panel. class DestroyOAuthApplication < Rectify::Command # Public: Initializes the command. # # application - The OAuthApplication to be destroyed. # user - The user that destroys the application. def initialize(application, current_user) @application = application @current_user = current_user end # Public: Executes the command. # # Broadcasts :ok if it got destroyed def call destroy_application broadcast(:ok) end private attr_reader :application, :current_user def destroy_application Decidim.traceability.perform_action!( "delete", application, current_user ) do application.destroy! end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems