Exception: Humanoid::Errors::Validations

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

Overview

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

Example:

Validations.new(person.errors)

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ Validations

Returns a new instance of Validations.



51
52
53
# File 'lib/humanoid/errors.rb', line 51

def initialize(errors)
  @errors = errors
end

Instance Method Details

#messageObject



54
55
56
# File 'lib/humanoid/errors.rb', line 54

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