Skip to content

Image attachments - #765

Closed
Nakushi64 wants to merge 13 commits into
Safecast:masterfrom
Nakushi64:image-attachment
Closed

Nakushi64 wants to merge 13 commits into
Safecast:masterfrom
Nakushi64:image-attachment

Conversation

@Nakushi64

Copy link
Copy Markdown
Contributor
  • Implemented the ability to attach images on device story pages via Cloudinary and CarrierWave
  • Fixed Rubocop issues coming from the master branch

Screenshot 2021-01-26 at 10 50 01

@matschaffer matschaffer linked an issue Jan 27, 2021 that may be closed by this pull request
6 of 9 tasks
config.storage = :file
config.enable_processing = false
# else
# Another if condition might be needed for DeviceStoryImageUploader

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nakushi64 I suspect this will break local log upload testing. Can you provide more info on why it's been removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matschaffer I had an issue where images would not get uploaded to Cloudinary but I would get a URL which pointed to nothing. Commenting out config.storage = :file solved it. This gave me the idea: https://stackoverflow.com/a/15961924/14162771 . How could I do an else if condition here for Cloudinary?


expect { post '/device_stories/1/device_story_comments', params: { device_story_comment: comment_params } }.to change { DeviceStoryComment.count }.by(0)
expect(response.status).to eq 302
expect(WebMock).not_to have_requested(:post, addressable)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this come out?

@Nakushi64 Nakushi64 Feb 3, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matschaffer This is related to the .save coming before .spam? bug. Fixing that caused Rspec to fail the test because now there were 2 requests coming through. As I understand it this line expects no requests to have been made to Akismet but that did not make sense for me since requests must be made to check for spam.

@eitoball

Copy link
Copy Markdown
Member

I think that we should use Active Storage for image attachment instead. See #775.

@matschaffer

Copy link
Copy Markdown
Contributor

Closing in favor of #775

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.

3 participants