class Mongoid::Errors::InverseNotFound

Raised when no inverse_of definition can be found when needed.

Public Class Methods

new(base, name, klass, inverse) click to toggle source

Create then new error.

@example Create the new error.

InverseNotFound.new(Town, :citizens, Person, :town_id)

@param [ Class ] base The base class. @param [ Symbol ] name The name of the association. @param [ Class ] klass The child class. @param [ Symbol ] inverse The attempted inverse key.

@since 3.0.0

Calls superclass method
# File lib/mongoid/errors/inverse_not_found.rb, line 21
def initialize(base, name, klass, inverse)
  super(
    compose_message(
      "inverse_not_found",
      { base: base, name: name, klass: klass, inverse: inverse }
    )
  )
end