Exception: Mongoid::Errors::InvalidPersistenceOption

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

Overview

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

Since:

  • 6.0.0

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.

Since:

  • 6.0.0



21
22
23
24
25
26
27
28
# File 'build/mongoid-master/lib/mongoid/errors/invalid_persistence_option.rb', line 21

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