-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1258 avoid setting key when creating attachment #1259
Conversation
LCOV of commit
|
db509e7
to
4f24f69
Compare
app/api/helpers/container_helpers.rb
Outdated
@@ -79,7 +79,7 @@ def create_or_update_attachments(container, attachments) | |||
return unless can_update | |||
attachments.each do |att| | |||
if att[:is_new] | |||
attachment = Attachment.where(storage: 'tmp', key: att[:id]).last | |||
attachment = Attachment.where(key: att[:id]).last |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/CyclomaticComplexity: Cyclomatic complexity for create_or_update_attachments is too high. [10/7]
app/api/helpers/container_helpers.rb
Outdated
@@ -79,7 +79,7 @@ def create_or_update_attachments(container, attachments) | |||
return unless can_update | |||
attachments.each do |att| | |||
if att[:is_new] | |||
attachment = Attachment.where(storage: 'tmp', key: att[:id]).last | |||
attachment = Attachment.where(key: att[:id]).last |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/PerceivedComplexity: Perceived complexity for create_or_update_attachments is too high. [11/8]
009b3a2
to
1f0b021
Compare
do not set a fix key while creating attachments as it otherwise produces the same file path for all template attachments
(kept the TransferFileFromTmpJob for now: need to ensure there is no instance of it being queued)
1f0b021
to
0e30667
Compare
@@ -825,7 +825,7 @@ | |||
describe 'update sample analysis with a new dataset and a new img file' do | |||
before do | |||
attachment = Attachment.find_by(filename: 'upload.jpg') | |||
attachment.key = '8580a8d0-4b83-11e7-afc4-85a98b9d0194' | |||
attachment.attachable = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec/MultipleMemoizedHelpers: Example group has too many memoized helpers [19/10]
@@ -825,7 +825,7 @@ | |||
describe 'update sample analysis with a new dataset and a new img file' do | |||
before do | |||
attachment = Attachment.find_by(filename: 'upload.jpg') | |||
attachment.key = '8580a8d0-4b83-11e7-afc4-85a98b9d0194' | |||
attachment.attachable = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingWhitespace: Trailing whitespace detected.
LCOV of commit
|
* use db-generated identifier to build the shrine id * fix seed for report templates: do not set a fix key while creating attachments as it otherwise produces the same file path for all template attachments * Attachment: clean deprecated logic updating the storage attribute (kept the TransferFileFromTmpJob for now: need to ensure there is no instance of it being queued) * do not set attachment storage to tmp (default 'local') * upd specs
* use db-generated identifier to build the shrine id * fix seed for report templates: do not set a fix key while creating attachments as it otherwise produces the same file path for all template attachments * Attachment: clean deprecated logic updating the storage attribute (kept the TransferFileFromTmpJob for now: need to ensure there is no instance of it being queued) * do not set attachment storage to tmp (default 'local') * upd specs
* use db-generated identifier to build the shrine id * fix seed for report templates: do not set a fix key while creating attachments as it otherwise produces the same file path for all template attachments * Attachment: clean deprecated logic updating the storage attribute (kept the TransferFileFromTmpJob for now: need to ensure there is no instance of it being queued) * do not set attachment storage to tmp (default 'local') * upd specs
No description provided.