Sha256: 60a9de8de74664dbc593a990e3b99963ec75147193e3a84f6decff0d97fb7d39
Contents?: true
Size: 725 Bytes
Versions: 34
Compression:
Stored size: 725 Bytes
Contents
module Hyrax module Actors # Wrap the stack in a database transaction. # This will roll back any database actions (particularly workflow) if there # is an error elsewhere in the actor stack. class TransactionalRequest < Actors::AbstractActor # @param [Hyrax::Actors::Environment] env # @return [Boolean] true if create was successful def create(env) ActiveRecord::Base.transaction do next_actor.create(env) end end # @param [Hyrax::Actors::Environment] env # @return [Boolean] true if update was successful def update(env) ActiveRecord::Base.transaction do next_actor.update(env) end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems