Fixes issue with import of empty protocol [fixes SCI-314]

This commit is contained in:
Oleksii Kriuchykhin 2016-09-20 13:41:29 +02:00
parent 57563b9a18
commit 9b7360eebf

View file

@ -48,7 +48,9 @@ module ProtocolsImporter
asset_ids = []
step_pos = 0
protocol_json["steps"].values.each do |step_json|
# Check if protocol has steps
if protocol_json["steps"]
protocol_json["steps"].values.each do |step_json|
step = Step.create!(
name: step_json["name"],
description: step_json["description"],
@ -120,6 +122,7 @@ module ProtocolsImporter
end
end
end
end
# Post process assets
asset_ids.each do |asset_id|