Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hh1966
chemotion_eln_server
Commits
67b0cdd7
Commit
67b0cdd7
authored
Mar 12, 2019
by
hh1966
Browse files
Import research plans
parent
c7c9033c
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/import/import_collections.rb
View file @
67b0cdd7
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment