class Mongoid::Errors::Validations

Raised when a persistence method ending in ! fails validation. The message will contain the full error messages from the Document in question.

@example Create the error.

Validations.new(person.errors)

Attributes

document[R]
record[R]

Public Class Methods

new(document) click to toggle source
Calls superclass method
# File lib/mongoid/errors/validations.rb, line 16
def initialize(document)
  @document = document

  super(
    compose_message(
      "validations",
      {
        document: document.class,
        errors: document.errors.full_messages.join(", ")
      }
    )
  )
end