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
e7897079
Commit
e7897079
authored
Apr 13, 2019
by
hh1966
Browse files
Use identifier for attachments export
parent
53157f8c
Pipeline
#45277
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/export/export_collections.rb
View file @
e7897079
...
...
@@ -61,7 +61,7 @@ module Export
# write all attachemnts into an attachments directory
@attachments
.
each
do
|
attachment
|
attachment_path
=
File
.
join
(
'attachments'
,
attachment
.
filename
)
attachment_path
=
File
.
join
(
'attachments'
,
attachment
.
identifier
)
zip
.
put_next_entry
attachment_path
zip
.
write
attachment
.
read_file
description
+=
"
#{
attachment
.
checksum
}
#{
attachment_path
}
\n
"
...
...
lib/import/import_collections.rb
View file @
e7897079
...
...
@@ -360,7 +360,7 @@ module Import
attachable
=
@instances
.
fetch
(
attachable_type
).
fetch
(
attachable_uuid
)
# construct file path
file_path
=
File
.
join
(
@directory
,
'attachments'
,
fields
.
fetch
(
'
filename
'
))
file_path
=
File
.
join
(
@directory
,
'attachments'
,
fields
.
fetch
(
'
identifier
'
))
# create the attachment
attachment
=
attachable
.
attachments
.
create!
(
...
...
hh1966
@hh1966
mentioned in issue
#2 (closed)
·
Apr 13, 2019
mentioned in issue
#2 (closed)
mentioned in issue #2
Toggle commit list
hh1966
@hh1966
mentioned in issue
#3 (closed)
·
Apr 13, 2019
mentioned in issue
#3 (closed)
mentioned in issue #3
Toggle commit list
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