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

skip protection to aws3

parent a699ebdb
class FilesController < ApplicationController
def download
uploader = Note.find(params[:id]).attachment
uploader.retrieve_from_store!(params[:filename])
send_file uploader.file.path, disposition: 'attachment'
end
end
......
......@@ -21,6 +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
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