Commit db6b9254 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

skip protection to aws3

parent ddad27dd5787
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 @@ ...@@ -21,6 +21,10 @@
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
Supports Markdown
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