This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
2012-01-11 12:14:28 +00:00
|
|
|
#require 'carrierwave/orm/mongoid'
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
begin
|
|
|
|
db_config = YAML::load(File.read(File.join(Rails.root, "/config/mongoid.yml")))
|
|
|
|
rescue
|
|
|
|
raise IOError, 'config/mongoid.yml could not be loaded'
|
|
|
|
end
|
|
|
|
|
|
|
|
CarrierWave.configure do |config|
|
|
|
|
config.grid_fs_database = db_config[Rails.env]['database']
|
|
|
|
config.grid_fs_host = db_config[Rails.env]['host']
|
|
|
|
config.grid_fs_port = db_config[Rails.env]['port']
|
|
|
|
config.storage = :grid_fs
|
|
|
|
config.grid_fs_access_url = "/gridfs"
|
|
|
|
end
|