Skip to content
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

Merged
merged 5 commits into from
Apr 11, 2023

Conversation

PiTrem
Copy link
Member

@PiTrem PiTrem commented Apr 3, 2023

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

LCOV of commit db509e7 during Continuous Integration #774

Summary coverage rate:
  lines......: 59.8% (11726 of 19620 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem force-pushed the 1258-avoid-setting-key-when-creating-attachment branch from db509e7 to 4f24f69 Compare April 4, 2023 15:57
@@ -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
Copy link

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]

@@ -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
Copy link

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]

@PiTrem PiTrem force-pushed the 1258-avoid-setting-key-when-creating-attachment branch from 009b3a2 to 1f0b021 Compare April 5, 2023 15:30
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)
@PiTrem PiTrem force-pushed the 1258-avoid-setting-key-when-creating-attachment branch from 1f0b021 to 0e30667 Compare April 11, 2023 02:58
@@ -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

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

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.

@github-actions
Copy link

LCOV of commit 0e30667 during Continuous Integration #819

Summary coverage rate:
  lines......: 59.8% (11733 of 19606 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem merged commit 2224dec into main Apr 11, 2023
2 checks passed
PiTrem added a commit that referenced this pull request Apr 11, 2023
* 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
mekkyz pushed a commit that referenced this pull request Sep 21, 2023
* 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
baolanlequang pushed a commit that referenced this pull request Mar 5, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

avoid setting key when creating attachment
2 participants