activeadmin_jfu_upload 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activeadmin/jfu_upload/engine.rb +4 -3
- data/lib/activeadmin/jfu_upload/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 823d82bb893dce7d514df47096473bbcfd552997
|
4
|
+
data.tar.gz: 9549971db2e52b04c5819ff08c512d46e9d1fec0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
22
|
-
|
23
|
-
|
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
|