Accessing the CarrierWave configuration?

1,721 views
Skip to first unread message

Jay Levitt

unread,
Oct 24, 2011, 11:44:48 AM10/24/11
to carri...@googlegroups.com
I want to specify a different fog_directory for our test and production systems. For efficiency, we construct the public URLs ourselves[1], so I'd like to be able to check my config.fog_directory from outside CarrierWave.

Our uploader class is AvatarUploader, and looking at the gem, I would expect that I could look at (e.g.) AvatarUploader.fog_credentials.  That method does exist, but that's an empty hash. Where did the configuration go?

[1] I think CarrierWave now does that efficiently without checking the file each time, but we're stuck on an old version until we wean ourselves off of ImageScience).

wprater

unread,
Mar 25, 2012, 11:44:27 PM3/25/12
to carri...@googlegroups.com
I'd love to get CarrierWave configs from within uploaders or outside the class as well.  Is there exposure?

Doug Johnston

unread,
May 9, 2012, 10:27:04 AM5/9/12
to carrierwave
You can use:

CarrierWave::Uploader::Base.fog_directory
CarrierWave::Uploader::Base.fog_credentials

etc...
Reply all
Reply to author
Forward
0 new messages