Fixed bug: Inconsistent data state for instance attribute on failed save! attempt.

This commit is contained in:
Thorsten Eckel 2017-08-30 17:16:27 +02:00
parent 6812c581c6
commit 4abd20a49f

View file

@ -9,6 +9,7 @@ class Sequencer
include ::Sequencer::Unit::Import::Common::Model::Mixin::HandleFailure
uses :instance, :dry_run
provides :instance
def process
return if dry_run
@ -16,6 +17,9 @@ class Sequencer
instance.save!
rescue => e
handle_failure(e)
# unset instance if something went wrong
state.provide(:instance, nil)
end
end
end