Exception: Mongoid::Errors::InvalidPersistenceOption

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

Overview

Raised when invalid options are used to create a persistence context.

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(invalid, valid) ⇒ InvalidPersistenceOption

Instantiate the persistence context option error.

Examples:

Create the error.

InvalidPersistenceOption.new(:invalid_option, [ :connect_timeout, :database ])

Parameters:

  • invalid (Symbol)

    The invalid option.

  • valid (Array<Symbol>)

    The allowed options.



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

def initialize(invalid, valid)
  super(
      compose_message(
          "invalid_persistence_option",
          { invalid: invalid, valid: valid }
      )
  )
end