Commit 4821aa6c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

skip protection to aws3

parent a699ebdb
class FilesController < ApplicationController class FilesController < ApplicationController
def download def download
uploader = Note.find(params[:id]).attachment uploader = Note.find(params[:id]).attachment
uploader.retrieve_from_store!(params[:filename])
send_file uploader.file.path, disposition: 'attachment' send_file uploader.file.path, disposition: 'attachment'
end end
end end
......
...@@ -21,6 +21,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base ...@@ -21,6 +21,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end end
def secure_url def secure_url
"/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}" if self.class.storage == CarrierWave::Storage::File
"/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
else
url
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment