diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-15 23:35:59 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-15 23:35:59 +0400 |
commit | 9e0246684d14e5323cfb71291faff290e2762f48 (patch) | |
tree | e9ae0f2613688ad83798ec4ee0e525d6e246b511 /app/uploaders/attachment_uploader.rb | |
parent | ced044ad249f794370ea111532a30f81a3c83408 (diff) |
Files controller handle redirect to remote storage. Added config block to carrierwave init
Diffstat (limited to 'app/uploaders/attachment_uploader.rb')
-rw-r--r-- | app/uploaders/attachment_uploader.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index 960e71ef640..c0afe9686f1 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -21,10 +21,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base end def secure_url - if self.class.storage == CarrierWave::Storage::File - "/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}" - else - url - end + "/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}" + end + + def file_storage? + self.class.storage == CarrierWave::Storage::File end end |