2014-01-16 10:15:00 +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']
|
2014-03-19 10:29:02 +00:00
|
|
|
config.grid_fs_username = db_config[Rails.env]['username']
|
|
|
|
config.grid_fs_password = db_config[Rails.env]['password']
|
2014-01-16 10:15:00 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/
|