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

Version Path
decidim-system-0.26.10 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.9 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.8 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.7 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.5 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.4 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.3 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.2 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.1 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.0 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.0.rc2 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.26.0.rc1 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.2 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.1 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.0 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.0.rc4 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.0.rc3 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.0.rc2 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.25.0.rc1 app/commands/decidim/system/destroy_oauth_application.rb
decidim-system-0.24.3 app/commands/decidim/system/destroy_oauth_application.rb