Class: Mongoid::Errors::StaleDocument
- Inherits:
-
MongoidError
- Object
- MongoidError
- Mongoid::Errors::StaleDocument
- Defined in:
- lib/mongoid/errors/stale_document.rb
Overview
Raised when trying to update a document that has been updated by another process.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
-
#initialize(action, document) ⇒ StaleDocument
constructor
A new instance of StaleDocument.
Constructor Details
#initialize(action, document) ⇒ StaleDocument
Returns a new instance of StaleDocument.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mongoid/errors/stale_document.rb', line 15 def initialize(action, document) @action = action @document = document super( translate( "stale_document.#{action}", { :klass => document.class.name } ) ) end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
13 14 15 |
# File 'lib/mongoid/errors/stale_document.rb', line 13 def action @action end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
13 14 15 |
# File 'lib/mongoid/errors/stale_document.rb', line 13 def document @document end |