Exception: Mongoid::Errors::UnsavedDocument
- Inherits:
-
MongoidError
- Object
- StandardError
- MongoidError
- Mongoid::Errors::UnsavedDocument
- Defined in:
- lib/mongoid/errors/unsaved_document.rb
Overview
Raised when attempting to call create or create! through a references_many when the parent document has not been saved. This prevents the child from getting presisted and immediately being orphaned.
Constant Summary
Constant Summary
Constants inherited from MongoidError
Instance Method Summary (collapse)
-
- (UnsavedDocument) initialize(base, document)
constructor
A new instance of UnsavedDocument.
Methods inherited from MongoidError
#compose_message, #problem, #resolution, #summary, #translate
Constructor Details
- (UnsavedDocument) initialize(base, document)
A new instance of UnsavedDocument
9 10 11 12 13 14 15 16 |
# File 'lib/mongoid/errors/unsaved_document.rb', line 9 def initialize(base, document) super( ( "unsaved_document", { base: base.class.name, document: document.class.name } ) ) end |