class Wallaby::Configuration::Mapping

Configuration used in {Wallaby::Map} @since wallaby-5.1.6

Public Instance Methods

model_authorizer() click to toggle source

@!attribute [r] model_authorizer To globally configure the model authorizer.

If no configuration is given, Wallaby will look up from the following authorizer classes and use the first available one:

  • ::Admin::ApplicationAuthorizer (only when it inherits from {Wallaby::ModelAuthorizer})

  • {Wallaby::ModelAuthorizer}

@example To update the model authorizer to `GlobalModelAuthorizer` in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.mapping.model_authorizer = ::GlobalModelAuthorizer
end

@return [Class] model authorizer class @since wallaby-5.2.0

# File lib/wallaby/configuration/mapping.rb, line 110
def model_authorizer
  @model_authorizer ||=
    defined?(::Admin::ApplicationAuthorizer) \
      && ::Admin::ApplicationAuthorizer < ::Wallaby::ModelAuthorizer \
      && 'Admin::ApplicationAuthorizer'
  to_class @model_authorizer ||= 'Wallaby::ModelAuthorizer'
end
model_authorizer=(model_authorizer) click to toggle source

@!attribute [w] model_authorizer

# File lib/wallaby/configuration/mapping.rb, line 92
def model_authorizer=(model_authorizer)
  @model_authorizer = to_class_name model_authorizer
end
model_paginator() click to toggle source

@!attribute [r] model_paginator To globally configure the resource paginator.

If no configuration is given, Wallaby will look up from the following paginator classes and use the first available one:

  • ::Admin::ApplicationPaginator (only when it inherits from {Wallaby::ModelPaginator})

  • {Wallaby::ModelPaginator}

@example To update the resource paginator to `GlobalModelPaginator` in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.mapping.model_paginator = ::GlobalModelPaginator
end

@return [Class] resource paginator class @since wallaby-5.2.0

# File lib/wallaby/configuration/mapping.rb, line 137
def model_paginator
  @model_paginator ||=
    defined?(::Admin::ApplicationPaginator) \
      && ::Admin::ApplicationPaginator < ::Wallaby::ModelPaginator \
      && 'Admin::ApplicationPaginator'
  to_class @model_paginator ||= 'Wallaby::ModelPaginator'
end
model_paginator=(model_paginator) click to toggle source

@!attribute [w] model_paginator

# File lib/wallaby/configuration/mapping.rb, line 119
def model_paginator=(model_paginator)
  @model_paginator = to_class_name model_paginator
end
model_servicer() click to toggle source

@!attribute [r] model_servicer To globally configure the model servicer.

If no configuration is given, Wallaby will look up from the following servicer classes and use the first available one:

  • ::Admin::ApplicationServicer (only when it inherits from {Wallaby::ModelServicer})

  • {Wallaby::ModelServicer}

@example To update the model servicer to `GlobalModelServicer` in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.mapping.model_servicer = ::GlobalModelServicer
end

@return [Class] model servicer class @since wallaby-5.1.6

# File lib/wallaby/configuration/mapping.rb, line 83
def model_servicer
  @model_servicer ||=
    defined?(::Admin::ApplicationServicer) \
      && ::Admin::ApplicationServicer < ::Wallaby::ModelServicer \
      && 'Admin::ApplicationServicer'
  to_class @model_servicer ||= 'Wallaby::ModelServicer'
end
model_servicer=(model_servicer) click to toggle source

@!attribute [w] model_servicer

# File lib/wallaby/configuration/mapping.rb, line 65
def model_servicer=(model_servicer)
  @model_servicer = to_class_name model_servicer
end
resource_decorator() click to toggle source

@!attribute [r] resource_decorator To globally configure the resource decorator.

If no configuration is given, Wallaby will look up from the following decorator classes and use the first available one:

  • ::Admin::ApplicationDecorator (only when it inherits from {Wallaby::ResourceDecorator})

  • {Wallaby::ResourceDecorator}

@example To update the resource decorator to `GlobalResourceDecorator` in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.mapping.resource_decorator = ::GlobalResourceDecorator
end

@return [Class] resource decorator class @since wallaby-5.1.6

# File lib/wallaby/configuration/mapping.rb, line 56
def resource_decorator
  @resource_decorator ||=
    defined?(::Admin::ApplicationDecorator) \
      && ::Admin::ApplicationDecorator < ::Wallaby::ResourceDecorator \
      && 'Admin::ApplicationDecorator'
  to_class @resource_decorator ||= 'Wallaby::ResourceDecorator'
end
resource_decorator=(resource_decorator) click to toggle source

@!attribute [w] resource_decorator

# File lib/wallaby/configuration/mapping.rb, line 38
def resource_decorator=(resource_decorator)
  @resource_decorator = to_class_name resource_decorator
end
resources_controller() click to toggle source

@!attribute [r] resources_controller To globally configure the resources controller.

If no configuration is given, Wallaby will look up from the following controller classes and use the first available one:

  • ::Admin::ApplicationController (only when it inherits from {Wallaby::ResourcesController})

  • {Wallaby::ResourcesController}

@example To update the resources controller to `GlobalResourcesController` in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.mapping.resources_controller = ::GlobalResourcesController
end

@return [Class] resources controller class @since wallaby-5.1.6

# File lib/wallaby/configuration/mapping.rb, line 29
def resources_controller
  @resources_controller ||=
    defined?(::Admin::ApplicationController) \
      && ::Admin::ApplicationController < ::Wallaby::ResourcesController \
      && 'Admin::ApplicationController'
  to_class @resources_controller ||= 'Wallaby::ResourcesController'
end
resources_controller=(resources_controller) click to toggle source

@!attribute [w] resources_controller

# File lib/wallaby/configuration/mapping.rb, line 11
def resources_controller=(resources_controller)
  @resources_controller = to_class_name resources_controller
end