Commit aca59961 authored by hh1966's avatar hh1966
Browse files

Add (some) containers and attachments to ExportCollectionJson

parent c4aaa39b
......@@ -51,6 +51,14 @@ module Export
:sample_id => 'samples',
})
# fetch containers and attachments
fetch_one(sample.container, {
:containable_id => 'samples',
})
fetch_many(sample.container.attachments, {
:attachable_id => 'containers',
})
# fetch literals
# a manual query needed since there is no Active Record Associations available
literals = Literal.where("element_id = ? AND element_type = 'Sample'", sample.id)
......@@ -87,6 +95,14 @@ module Export
})
end
# fetch containers and attachments
fetch_one(reaction.container, {
:containable_id => 'samples',
})
fetch_many(reaction.container.attachments, {
:attachable_id => 'containers',
})
# fetch literals
# a manual query needed since there is no Active Record Associations available
literals = Literal.where("element_id = ? AND element_type = 'Reaction'", reaction.id)
......
Supports Markdown
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