Class: Hyrax::Actors::OptimisticLockValidator
- Inherits:
-
AbstractActor
- Object
- AbstractActor
- Hyrax::Actors::OptimisticLockValidator
- Defined in:
- app/actors/hyrax/actors/optimistic_lock_validator.rb
Overview
Validates that the submitted version is the most recent version in the datastore. Caveat: we are not detecting if the version is changed by a different process between the time this validator is run and when the object is saved
Instance Attribute Summary
Attributes inherited from AbstractActor
Instance Method Summary collapse
-
#update(env) ⇒ Boolean
True if update was successful.
Methods inherited from AbstractActor
Constructor Details
This class inherits a constructor from Hyrax::Actors::AbstractActor
Instance Method Details
#update(env) ⇒ Boolean
Returns true if update was successful.
13 14 15 |
# File 'app/actors/hyrax/actors/optimistic_lock_validator.rb', line 13 def update(env) validate_lock(env, version_attribute(env.attributes)) && next_actor.update(env) end |