Commit 958a7a79 authored by hh1966's avatar hh1966
Browse files

Import residues

parent 97c305b9
......@@ -39,6 +39,7 @@ module Import
ActiveRecord::Base.transaction do
import_collections
import_samples
import_residues
import_reactions
import_reactions_samples
import_wellplates
......@@ -121,6 +122,23 @@ module Import
end
end
def import_residues
@data.fetch('Residue', {}).each do |uuid, fields|
# create the sample
residue = Residue.create!(fields.slice(
'residue_type',
'custom_info',
'created_at',
'updated_at'
).merge({
:sample => @instances.fetch('Sample').fetch(fields.fetch('sample_id'))
}))
# add reaction to the @instances map
update_instances!(uuid, residue)
end
end
def import_reactions
@data.fetch('Reaction', {}).each do |uuid, fields|
# create the sample
......
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