Exception: Mongoid::Errors::InvalidConfigOption

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/invalid_config_option.rb

Overview

This error is raised when a bad configuration option is attempted to be set.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(name) ⇒ InvalidConfigOption

Create the new error.

Examples:

Create the new error.

InvalidConfigOption.new(:name, [ :option ])

Parameters:

  • name (Symbol | String)

    The attempted config option name.



17
18
19
20
21
22
23
24
# File 'lib/mongoid/errors/invalid_config_option.rb', line 17

def initialize(name)
  super(
    compose_message(
      "invalid_config_option",
      { name: name, options: Config.settings.keys.map(&:inspect).join(", ") }
    )
  )
end