How to print out CarrierWaves configuration values in the Rails console?

Viewed 1018

I have a running Rails app with the CarrierWave gem.

I am able to see the CarrierWave class in the Rails console, and identify methods etc, but am not able to figure out how to print the configuration variables I set in my app. I looked over the docs and have set the config working correctly as per http://www.rubydoc.info/gems/carrierwave#Using_Amazon_S3 but was not able to figure out how to display config settings in the Rails console. It would allow on the fly changes and testing.

This info would be useful for other gems too.

2 Answers

Let's say that your uploader class is PhotoUploader

in the console

PhotoUploader.fog_credentials

PhotoUploader.fog_directory

and so on

Or as instantiated object

u = PhotoUploader.new

u.fog_credentials

u.fog_directory

These will print out the initialized configuration.

You can read configurations from the base uploader

CarrierWave::Uploader::Base.asset_host
Related