activeadmin_jfu_upload 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5a53268de956e2bc17f21c73413e3956b27086a
4
- data.tar.gz: f70b86ce94ce271a8de8c7047432bd0c6005f7ad
3
+ metadata.gz: 823d82bb893dce7d514df47096473bbcfd552997
4
+ data.tar.gz: 9549971db2e52b04c5819ff08c512d46e9d1fec0
5
5
  SHA512:
6
- metadata.gz: 0b6cfd84bbc166a14e95c9a0da3e7ae692d24e8065cb55283fc0bfb2904050159cda6ccbb48539fef8d3b0bfeab1f4c68398b79f2b79abd8d13223416859b0f5
7
- data.tar.gz: da3c2a7d7db0e1cb46566dfef7a9e30ad42182dec24d25637a10168584e70cd6fe0d6d9701bd2e62654d696eb490fb871ddfb2fa398cac9e4db4ef9a238e453d
6
+ metadata.gz: 3a308e53a0bcc514df5e7a06464ec07ef11b70304704d4568d1ed0185a2a405f1baedf13fa4d2e5c494dd0580c180501a5a156a25f4c6a899b55bda969e5955f
7
+ data.tar.gz: 5ccbce78997f1a403d1b74ddd98827b2062808b006f6865fed46848c5078dc754ff80b1f6ad9ebe7e975c38a8e8956a6d82e77370324ab896b623ba01de733a8
@@ -18,9 +18,10 @@ module ActiveAdmin
18
18
  buffer = param.read
19
19
  pos = m[1].to_i
20
20
  if pos == 0
21
- dir = Rails.root.join('public', 'uploads')
22
- dir.mkdir unless File.exists?(dir)
23
- 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}"
21
+ tempfile = Rails.root.join('tmp', "upload_#{Time.now.to_i}_#{resource.id}_#{field}")
22
+ field_data = { original_filename: param.original_filename, tempfile: tempfile }
23
+ # dir.mkdir unless File.exists?(dir)
24
+ # 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}"
24
25
  resource.update_column field, YAML::dump( field_data )
25
26
  mode = 'wb'
26
27
  else
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module JfuUpload
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_jfu_upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton