2015-05-08 20:18:18 +02:00
|
|
|
Paperclip::Attachment.default_options[:storage] = :fog
|
|
|
|
Paperclip::Attachment.default_options[:fog_credentials] = {:provider => "Local", :local_root => "#{Rails.root}/public"}
|
|
|
|
Paperclip::Attachment.default_options[:fog_directory] = "/system"
|
|
|
|
Paperclip::Attachment.default_options[:fog_host] = "/system"
|
2015-05-09 16:18:34 +02:00
|
|
|
|
2015-05-08 20:18:18 +02:00
|
|
|
unless APP_CONFIG["fog"].nil?
|
|
|
|
Paperclip::Attachment.default_options[:fog_credentials] = APP_CONFIG["fog"]["credentials"] unless APP_CONFIG["fog"]["credentials"].nil?
|
|
|
|
Paperclip::Attachment.default_options[:fog_directory] = APP_CONFIG["fog"]["directory"] unless APP_CONFIG["fog"]["directory"].nil?
|
|
|
|
Paperclip::Attachment.default_options[:fog_host] = APP_CONFIG["fog"]["host"] unless APP_CONFIG["fog"]["host"].nil?
|
2015-05-09 16:18:34 +02:00
|
|
|
|
|
|
|
if not APP_CONFIG["fog"]["credentials"].nil? and APP_CONFIG["fog"]["host"].nil?
|
|
|
|
Paperclip::Attachment.default_options[:fog_host] = nil
|
|
|
|
end
|
2015-05-08 20:18:18 +02:00
|
|
|
end
|