Method: Mongoid::Errors::Callback#initialize

Defined in:
lib/mongoid/errors/callback.rb

#initialize(klass, method) ⇒ Callback

Create the new callbacks error.

Examples:

Create the new callbacks error.

Callbacks.new(Post, :create!)

Parameters:

  • klass (Class)

    The class of the document.

  • method (Symbol)

    The name of the method.

Since:

  • 2.2.0



20
21
22
23
# File 'lib/mongoid/errors/callback.rb', line 20

def initialize(klass, method)
  @klass, @method = klass, method
  super(translate("callbacks", { :klass => klass, :method => method }))
end