class Praxis::Plugins::MapperPlugin::Plugin

The Mapper plugin is an overarching set of things to include in your application when you want to use the rendring, field_selection, filtering (and potentially pagination) extensions To use the plugin, set it up like any other plugin by registering to the bootloader. Typically you’d do that in environment.rb, inside the ‘Praxis::Application.configure do |application|` block, by:

application.bootloader.use Praxis::Plugins::MapperPlugin

The plugin accepts only 1 configuration option thus far, which you can set inside the same block as:

application.config.mapper.debug_queries = true

when debug_queries is set to true, the system will output information about the expanded fields and associations that the system ihas calculated necessary to pull from the DB, based on the requested API fields, API filters and ‘property` dependencies defined in the domain models (i.e., resources)

Public Instance Methods

config_key() click to toggle source
# File lib/praxis/plugins/mapper_plugin.rb, line 26
def config_key
  :mapper
end
load_config!() click to toggle source
# File lib/praxis/plugins/mapper_plugin.rb, line 30
def load_config!
  {} # override the default one, since we don't necessarily want to configure it via a yaml file.
end
prepare_config!(node) click to toggle source
# File lib/praxis/plugins/mapper_plugin.rb, line 34
def prepare_config!(node)
  node.attributes do
    attribute :debug_queries, Attributor::Boolean, default: false,
                                                   description: 'Weather or not to log debug information about queries executed in the build_query automation module'
  end
end