Exception: Mongoid::Errors::Validations

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

Overview

Raised when a persisence method ending in ! fails validation.

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ Validations

Returns a new instance of Validations.



23
24
25
# File 'lib/mongoid/errors.rb', line 23

def initialize(errors)
  @errors = errors
end

Instance Method Details

#messageObject



26
27
28
# File 'lib/mongoid/errors.rb', line 26

def message
  "Validation failed: #{@errors.full_messages}"
end