-
Notifications
You must be signed in to change notification settings - Fork 165
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
Support CarrierWave 3.x #215
base: master
Are you sure you want to change the base?
Conversation
- Add spec/tmp to .gitignore - Fix warning 'Invalid update document provided' - Set files before testing behavior of #remove_uploaders= and #remove_uploader - Make sure to reset value of #remove_previously_stored_files_after_update
As CarrierWave 3.0 introduced filename deduplication, it will prevent mistakenly removing the newly-uploaded file in a different way.
if Gem::Version.new(CarrierWave::VERSION) >= Gem::Version.new("3.0.beta") | ||
include CarrierWave3 | ||
else | ||
include CarrierWavePre3 | ||
end |
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.
Changes in this file can be better understood by using ?w=1.
What I did was introducing new modules CarrierWave3
and CarrierWavePre3
, and conditionally include one of them based on the CarrierWave version.
end | ||
end | ||
} | ||
end |
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.
carrierwave-mongoid was heavily affected by the issue in carrierwave: carrierwaveuploader/carrierwave#2770. The issue is hard to investigate due to its nature, and affected many carrierwave versions (from 3.0.0 to 3.1.0). Hence I've added a monkey patch here, to ensure carrierwave-mongoid works with flawed carrierwave versions.
@rmm5t Hi! Any chance you can take a look at this? 🙏 |
This PR aims to make carrierwave-mongoid to work with CarrierWave 3.x, while keeping the support for older CarrierWave versions. Changes are separeted into several commits, to describe the intention better.