Fixed bug: Inconsistent data state for instance attribute on failed save! attempt.
This commit is contained in:
parent
6812c581c6
commit
4abd20a49f
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ class Sequencer
|
||||||
include ::Sequencer::Unit::Import::Common::Model::Mixin::HandleFailure
|
include ::Sequencer::Unit::Import::Common::Model::Mixin::HandleFailure
|
||||||
|
|
||||||
uses :instance, :dry_run
|
uses :instance, :dry_run
|
||||||
|
provides :instance
|
||||||
|
|
||||||
def process
|
def process
|
||||||
return if dry_run
|
return if dry_run
|
||||||
|
@ -16,6 +17,9 @@ class Sequencer
|
||||||
instance.save!
|
instance.save!
|
||||||
rescue => e
|
rescue => e
|
||||||
handle_failure(e)
|
handle_failure(e)
|
||||||
|
|
||||||
|
# unset instance if something went wrong
|
||||||
|
state.provide(:instance, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue