Skip to content

Commit

Permalink
Upload fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Roccoberton committed May 22, 2018
1 parent f7d96a3 commit 9bc377a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/activeadmin/jfu_upload/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def upload_file( request, param, resource, field )
buffer = param.read
pos = m[1].to_i
if pos == 0
dir = Rails.root.join('tmp', 'uploads')
dir = Rails.root.join('public', 'uploads')
dir.mkdir unless File.exists?(dir)
field_data = { original_filename: param.original_filename, tempfile: dir.join(param.tempfile).to_s } # alternative: "#{resource.class.to_s.tableize}_#{resource.id}_#{Time.now.to_i}"
resource.update_column field, YAML::dump( field_data )
Expand Down
2 changes: 1 addition & 1 deletion lib/activeadmin/jfu_upload/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ActiveAdmin
module JfuUpload
VERSION = '0.1.6'
VERSION = '0.1.7'
end
end

0 comments on commit 9bc377a

Please sign in to comment.