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

Update Callback Documentation #2717

Merged
merged 1 commit into from Jan 7, 2024
Merged

Conversation

jiikko
Copy link
Contributor

@jiikko jiikko commented Jan 4, 2024

No description provided.

README.md Outdated
def log_removal
::Rails.logger.info(format('Deleting file on S3: %s', @file))
def log_removal(file)
::Rails.logger.info(format('Deleting file on S3: %s', file))
Copy link
Member

Choose a reason for hiding this comment

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

Please clarify what sort of a problem this is trying to address.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mshibuya
Sorry for not explaining.

The reason I changed the argument was because an ArgmentError occurred.

F, [2024-01-07T18:02:54.020568 #88960] FATAL -- :
ArgumentError (wrong number of arguments (given 1, expected 0)):

app/uploaders/XXX_uploader.rb:14:in `log_retrieve_from_store'
carrierwave (2.2.2) lib/carrierwave/uploader/callbacks.rb:16:in `block in with_callbacks'
carrierwave (2.2.2) lib/carrierwave/uploader/callbacks.rb:16:in `each'
carrierwave (2.2.2) lib/carrierwave/uploader/callbacks.rb:16:in `with_callbacks'
carrierwave (2.2.2) lib/carrierwave/uploader/store.rb:86:in `retrieve_from_store!'
carrierwave (2.2.2) lib/carrierwave/uploader/versions.rb:327:in `block in retrieve_versions_from_store!'
carrierwave (2.2.2) lib/carrierwave/uploader/versions.rb:327:in `each'
carrierwave (2.2.2) lib/carrierwave/uploader/versions.rb:327:in `retrieve_versions_from_store!'
carrierwave (2.2.2) lib/carrierwave/uploader/callbacks.rb:16:in `block in with_callbacks'
carrierwave (2.2.2) lib/carrierwave/uploader/callbacks.rb:16:in `each'

Copy link
Member

Choose a reason for hiding this comment

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

The retrieve_from_store callback takes an argument,

with_callbacks(:retrieve_from_store, identifier) do

but the remove callback doesn't.
with_callbacks(:remove) do

So this change will break, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks to your explanation, I have completely understood...

I have canceled it 🙇

@mshibuya mshibuya merged commit d27c987 into carrierwaveuploader:master Jan 7, 2024
12 checks passed
@mshibuya
Copy link
Member

mshibuya commented Jan 7, 2024

Thanks 👍

@jiikko jiikko deleted the patch-1 branch January 7, 2024 10:08
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.

None yet

2 participants