Sha256: aaa3d414b8f8caed150210cc8e795550abd1dd217d7706a83147460524cc22a7

Contents?: true

Size: 830 Bytes

Versions: 12

Compression:

Stored size: 830 Bytes

Contents

module RailsAdmin
  EXTENSIONS = []
  AUTHORIZATION_ADAPTERS = {}
  AUDITING_ADAPTERS = {}
  CONFIGURATION_ADAPTERS = {}

  # 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 & 2 rubygems

Version Path
rails_admin-1.0.0.rc lib/rails_admin/extension.rb
rails_admin-0.8.1 lib/rails_admin/extension.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/lib/rails_admin/extension.rb
rails_admin-0.7.0 lib/rails_admin/extension.rb
rails_admin-0.6.8 lib/rails_admin/extension.rb
rails_admin-0.6.7 lib/rails_admin/extension.rb
rails_admin-0.6.6 lib/rails_admin/extension.rb
rails_admin-0.6.5 lib/rails_admin/extension.rb
rails_admin-0.6.4 lib/rails_admin/extension.rb
rails_admin-0.6.3 lib/rails_admin/extension.rb
rails_admin-0.6.2 lib/rails_admin/extension.rb
rails_admin-0.6.1 lib/rails_admin/extension.rb