Exception: Mongoid::Errors::Callback

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

Overview

This error is raised when calling #save! or .create! on a model when one of the callbacks returns false.

Constant Summary

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary (collapse)

Methods inherited from MongoidError

#compose_message

Constructor Details

- (Callback) initialize(klass, method)

Create the new callbacks error.

Examples:

Create the new callbacks error.

Callbacks.new(Post, :create!)

Since:

  • 2.2.0



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

def initialize(klass, method)
  super(
    compose_message("callbacks", { klass: klass, method: method })
  )
end