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.



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

def initialize(errors)
  @errors = errors
end

Instance Method Details

#messageObject



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

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