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

recreate_versions!, with fog, errors with undefined method `copy' for nil:NilClass #2739

Open
a-aerts opened this issue Apr 23, 2024 · 0 comments

Comments

@a-aerts
Copy link

a-aerts commented Apr 23, 2024

Hi,
I've tried updating Carrierwave from 2.2.6 to 3.0.7, in my code I've got following line:
attachment.file.recreate_versions!(:thumb)

It works fine on 2.2.6, on 3.0.7 it raises NoMethodError: undefined method `copy' for nil:NilClass from here:

file.copy(@uploader.fog_directory, new_path, copy_options)

In my case, I've noticed it happening when I'm changing file's name:

      attachment.file.rename(sanitized_file, keep_original: false)
      ThumbsJob.perform_later(attachment.id) if attachment.with_thumb?

Not sure if it's a bug connected to latest fixes regarding recreate_versions and original files, or I'm missing something?

Ruby 3.2.3, Rails 7.1.3.2, fog-aws 3.22.0

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

No branches or pull requests

1 participant