Commit 67b0cdd7 authored by hh1966's avatar hh1966
Browse files

Import research plans

parent c7c9033c
......@@ -50,6 +50,7 @@ module Import
import_wellplates
import_wells
import_screens
import_research_plans
import_containers
import_attachments
import_literals
......@@ -251,6 +252,27 @@ module Import
end
end
def import_research_plans
@data.fetch('ResearchPlan', []).each do |uuid, fields|
# create the screen
research_plan = ResearchPlan.create!(fields.slice(
'name',
'description',
'sdf_file',
'svg_file',
'created_at',
'updated_at'
).merge({
:created_by => @current_user_id,
:collections => fetch_many(
'Collection', 'CollectionsResearchPlan', 'research_plan_id', 'collection_id', uuid)
}))
# add reaction to the @instances map
update_instances!(uuid, research_plan)
end
end
def import_containers
@data.fetch('Container', []).each do |uuid, fields|
case fields.fetch('container_type')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment