refile-input 0.0.4 → 0.0.5

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: 9f3da1bf5e69b9e23d78bd6ad0e2ec31ea293b85
4
- data.tar.gz: 75a682c49afb9a195149d474c6c17202212e21da
3
+ metadata.gz: 50c568869da5939c8608749db716d01bd0b9b202
4
+ data.tar.gz: 149de7ac465d3999a06bb8e07a52885512471218
5
5
  SHA512:
6
- metadata.gz: feb4b5ef30a05a55a5df828a62cc59dbbb5a781c27e81b2bca5bf675a1e81143e417ca056508b4adf63d8e1853c889970b6a36113dd77856d27aba765712a614
7
- data.tar.gz: 916452928f9c354d36efb69e463ad043d99aab4aa4cd78d12ecca4d4e08bf0fe592ae4aa6a53929b20dedfd5515388566702de5fd0cb60d238c98743894536aa
6
+ metadata.gz: 2b83699825e9404253e32a0d32db60568cceec5186a3caf5bdc7828753b71c97602a1e51a1279481cd38429642f51871aabbd8ca323a9003d32c08eb2d06b78e
7
+ data.tar.gz: a382f57046eafe3543dd011b40e211e133aa82352af3fca5930808c0f3f6bbc441152ed9e3944456a225d9497e5b8187210fd875d040af27743993379a025729
@@ -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
- options[:data].merge!(direct: true).merge!(attacher.cache.presign.as_json)
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'
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
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-01-30 00:00:00.000000000 Z
12
+ date: 2016-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: formtastic