refile-input 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inputs/refile_input.rb +3 -2
- data/refile-input.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50c568869da5939c8608749db716d01bd0b9b202
|
4
|
+
data.tar.gz: 149de7ac465d3999a06bb8e07a52885512471218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b83699825e9404253e32a0d32db60568cceec5186a3caf5bdc7828753b71c97602a1e51a1279481cd38429642f51871aabbd8ca323a9003d32c08eb2d06b78e
|
7
|
+
data.tar.gz: a382f57046eafe3543dd011b40e211e133aa82352af3fca5930808c0f3f6bbc441152ed9e3944456a225d9497e5b8187210fd875d040af27743993379a025729
|
data/lib/inputs/refile_input.rb
CHANGED
@@ -4,9 +4,9 @@ class RefileInput < Formtastic::Inputs::FileInput
|
|
4
4
|
|
5
5
|
attacher = object.send(:"#{method}_attacher")
|
6
6
|
options[:accept] = attacher.definition.accept
|
7
|
+
host = options[:host] || Refile.host
|
7
8
|
|
8
9
|
if options[:direct]
|
9
|
-
host = options[:host] || Refile.host
|
10
10
|
backend_name = Refile.backends.key(attacher.cache)
|
11
11
|
|
12
12
|
url = ::File.join(host, Rails.application.routes.url_helpers.refile_app_path, backend_name)
|
@@ -14,7 +14,8 @@ class RefileInput < Formtastic::Inputs::FileInput
|
|
14
14
|
end
|
15
15
|
|
16
16
|
if options[:presigned] and attacher.cache.respond_to?(:presign)
|
17
|
-
|
17
|
+
url = ::File.join(host, Rails.application.routes.url_helpers.refile_app_path, backend_name, "presign")
|
18
|
+
options[:data].merge!(direct: true, url: url)
|
18
19
|
end
|
19
20
|
|
20
21
|
options.merge(input_html_options)
|
data/refile-input.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'refile-input'
|
3
3
|
s.license = 'MIT'
|
4
|
-
s.version = '0.0.
|
4
|
+
s.version = '0.0.5'
|
5
5
|
s.authors = ["Petr Sergeev", "Sindre Moen"]
|
6
6
|
s.email = ["peter@hyper.no", "sindre@hyper.no"]
|
7
7
|
s.description = "This adds custom input to support refile file uploader to formtastic form builder"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refile-input
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Sergeev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: formtastic
|