Sha256: a076b51e30192694797ca1a2a13970f1a3847c4cbb4c6efb19ee4b4ed7cbb005

Contents?: true

Size: 477 Bytes

Versions: 177

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module Motor
  class ResourceDefaultQueriesController < ApiBaseController
    skip_authorization_check

    before_action :authorize_resource

    def show
      render json: { data: { sql: resource_class.all.to_sql } }
    end

    private

    def resource_class
      @resource_class ||= Motor::BuildSchema::Utils.classify_slug(params[:resource])
    end

    def authorize_resource
      authorize!(resource_class, :manage)
    end
  end
end

Version data entries

177 entries across 177 versions & 7 rubygems

Version Path
motor-admin-0.4.34 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.33 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.32 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.31 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.30 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.29 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.28 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.35 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.34 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.33 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.32 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.31 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.30 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.29 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.28 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-cstham8-0.4.27 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-0.4.27 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-unosquare-0.4.28 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-unosquare-0.4.27 app/controllers/motor/resource_default_queries_controller.rb
motor-admin-pz-0.4.26 app/controllers/motor/resource_default_queries_controller.rb