Class: Hyrax::Actors::OptimisticLockValidator

Inherits:
AbstractActor show all
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

#next_actor

Instance Method Summary collapse

Methods inherited from AbstractActor

#initialize

Constructor Details

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

Instance Method Details

#update(attributes) ⇒ Object



10
11
12
# File 'app/actors/hyrax/actors/optimistic_lock_validator.rb', line 10

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