Exception: MongoMapper::DocumentNotValid

Inherits:
Error
  • Object
show all
Defined in:
lib/mongo_mapper/exceptions.rb

Overview

raised when document not valid and using !

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (DocumentNotValid) initialize(document)

Returns a new instance of DocumentNotValid



22
23
24
25
# File 'lib/mongo_mapper/exceptions.rb', line 22

def initialize(document)
  @document = document
  super("Validation failed: #{document.errors.full_messages.join(", ")}")
end

Instance Attribute Details

- (Object) document (readonly)

Returns the value of attribute document



20
21
22
# File 'lib/mongo_mapper/exceptions.rb', line 20

def document
  @document
end