Sha256: ca4c0c25ae14ae4d52aa75296bf0cf7ae4ecdf50c965f4c01dd3d1fec6d2bc33

Contents?: true

Size: 966 Bytes

Versions: 12

Compression:

Stored size: 966 Bytes

Contents

module RailsAdmin
  EXTENSIONS = [] # rubocop:disable MutableConstant
  AUTHORIZATION_ADAPTERS = {} # rubocop:disable MutableConstant
  AUDITING_ADAPTERS = {} # rubocop:disable MutableConstant
  CONFIGURATION_ADAPTERS = {} # rubocop:disable MutableConstant

  # Extend RailsAdmin
  #
  # The extension may define various adapters (e.g., for authorization) and
  # register those via the options hash.
  def self.add_extension(extension_key, extension_definition, options = {})
    options.assert_valid_keys(:authorization, :configuration, :auditing)

    EXTENSIONS << extension_key

    if options[:authorization]
      AUTHORIZATION_ADAPTERS[extension_key] = extension_definition::AuthorizationAdapter
    end

    if options[:configuration]
      CONFIGURATION_ADAPTERS[extension_key] = extension_definition::ConfigurationAdapter
    end

    if options[:auditing]
      AUDITING_ADAPTERS[extension_key] = extension_definition::AuditingAdapter
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_admin-1.4.3 lib/rails_admin/extension.rb
rails_admin-2.0.0 lib/rails_admin/extension.rb
rails_admin-2.0.0.rc lib/rails_admin/extension.rb
rails_admin-2.0.0.beta lib/rails_admin/extension.rb
rails_admin-1.4.2 lib/rails_admin/extension.rb
rails_admin-1.4.1 lib/rails_admin/extension.rb
rails_admin-1.4.0 lib/rails_admin/extension.rb
rails_admin-1.3.0 lib/rails_admin/extension.rb
rails_admin-1.2.0 lib/rails_admin/extension.rb
rails_admin-1.1.1 lib/rails_admin/extension.rb
rails_admin-1.1.0 lib/rails_admin/extension.rb
rails_admin-1.0.0 lib/rails_admin/extension.rb