class Mongoid::Errors::MongoidError

Default parent Mongoid error for all custom errors. This handles the base key for the translations and provides the convenience method for translating the messages.

Constants

BASE_KEY

Public Instance Methods

compose_message(key, attributes) click to toggle source

Compose the message.

@example Create the message

error.compose_message

@return [ String ] The composed message.

@since 3.0.0

# File lib/mongoid/errors/mongoid_error.rb, line 19
def compose_message(key, attributes)
  @problem = problem(key, attributes)
  @summary = summary(key, attributes)
  @resolution = resolution(key, attributes)

  "\nProblem:\n  #{@problem}"+
  "\nSummary:\n  #{@summary}"+
  "\nResolution:\n  #{@resolution}"
end