lib/eco/api/session/batch/job.rb in eco-helpers-2.0.25 vs lib/eco/api/session/batch/job.rb in eco-helpers-2.0.26
- old
+ new
@@ -302,10 +302,13 @@
# 2. if there were errors: launch specific error handlers if they are defined for the type of error
def post_launch(queue: [], simulate: false)
if !simulate && status
status.queue.map do |entry|
if status.success?(entry)
+ if type == :create && entry.respond_to?(:id=)
+ entry.id = status[entry].body["id"]
+ end
entry.consolidate! if entry.respond_to?(:consolidate!)
#else # do not entry.reset! (keep track on changes still)
end
end
# launch error_handlers
@@ -322,10 +325,15 @@
handler_job.launch(simulate: simulate)
end
end
end
elsif simulate
+ fake_id = 111111111111111111111111
queue.map do |entry|
+ if type == :create && entry.respond_to?(:id=)
+ entry.id = fake_id.to_s
+ fake_id += 1
+ end
entry.consolidate! if entry.respond_to?(:consolidate!)
end
end
end