Class: CurationConcerns::OptimisticLockValidator

Inherits:
Actors::AbstractActor show all
Defined in:
app/actors/curation_concerns/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 Actors::AbstractActor

#next_actor

Instance Method Summary collapse

Methods inherited from Actors::AbstractActor

#initialize

Constructor Details

This class inherits a constructor from CurationConcerns::Actors::AbstractActor

Instance Method Details

#update(attributes) ⇒ Object



9
10
11
# File 'app/actors/curation_concerns/optimistic_lock_validator.rb', line 9

def update(attributes)
  validate_lock(version_attribute(attributes)) && next_actor.update(attributes)
end