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

Add the cache_only configuration option #1456

merged 1 commit into from Sep 30, 2014


None yet
3 participants

jeffkreeftmeijer commented Sep 9, 2014

Hey everyone,

I’ve been trying to get test fixtures working on CarrierWave, and came up with a solution that works by monkey-patching CarrierWave::Mount::Mounter#store!. That way, you prevent CarrierWave from moving the files from the cache directory to the store_dir.

It’d be great to be able to set a configuration option in your tests instead of breaking a method in the mounter, so I added a configuration option called “cache_only”, which does the same thing. What do you think?


This comment has been minimized.


bensie commented Sep 30, 2014

Thanks @jeffkreeftmeijer looks great!

bensie added a commit that referenced this pull request Sep 30, 2014

Merge pull request #1456 from jeffkreeftmeijer/cache-only
Add the cache_only configuration option

@bensie bensie merged commit c82ad88 into carrierwaveuploader:master Sep 30, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build failed

This comment has been minimized.

pdobb commented Jun 7, 2017

@jeffkreeftmeijer How do we use this? Your blog post doesn't show how still and I'm not sure how to set the configuration option in Carrierwave in my test_helper. Thanks for any help and for your contribution!

I think I figured it out:

class ActiveSupport::TestCase
  # ...

  CarrierWave.configure do |config|
    config.root = Rails.root.join("test/fixtures/files")
    config.cache_only = true
    config.enable_processing = false = :file

  def after_teardown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment