glebtv-rails-uploader 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eb1d33b33685ada95ec0c342b1665baeb9bdefb83fb8e22330655a0a2c10f40
4
- data.tar.gz: 25ba543d30d3bf8bb46d47978df89a7a5bf7682a490d82590f1941738a32670d
3
+ metadata.gz: a65fb2766fd2ef01c7cb075ac96549741507a6f3406d83ca6a9bda634c85a4b6
4
+ data.tar.gz: e03d0977ea91682aed4977bfc3e0deb2b1b36506962826238b7cd790d3071b73
5
5
  SHA512:
6
- metadata.gz: fdf90f439f17b797ec5cd5971404aeeb4b49de4435af94c265c7580cd67a0a459526322a8ff8505826fd5bc225010dda456139610d8deb1237491814e52dc520
7
- data.tar.gz: 6a5a24e2c54d7d5382f2940620d367283f1b8c7ee6e20462240a29a013662bbfd8ee29c5c7e3a9df65adc1f10d689f464ae670a5831d525198cee813777de7ac
6
+ metadata.gz: b879eacb0c7d40e4484d5b8a5e7f7022f0bb00a4113c8c0282a21d93663d707204c3ec3286d53838065e88857603e9368bc3b67e409e4a4e356c81c0ce78599f
7
+ data.tar.gz: 616d64f4e4d5e8d1283101057681a4fa6d80a50e39cbb8244229506e15f228295fe6dd89d7e377b7b94cbe0c353fd1f26d572b09ead526b38df0d0010fc8ff4f
@@ -1,16 +1,16 @@
1
1
  module Uploader
2
2
  class AttachmentsController < ActionController::Metal
3
3
  include AbstractController::Callbacks
4
-
5
- before_filter :find_klass
6
- before_filter :find_asset, :only => [:destroy]
7
-
4
+
5
+ before_action :find_klass
6
+ before_action :find_asset, :only => [:destroy]
7
+
8
8
  def create
9
9
  @asset = @klass.new(params[:asset])
10
10
  @asset.uploader_create(params, request)
11
11
  render_resourse(@asset, 201)
12
12
  end
13
-
13
+
14
14
  def update
15
15
  @assets = Array.wrap(params[:assets] || [])
16
16
 
@@ -25,9 +25,9 @@ module Uploader
25
25
  @asset.uploader_destroy(params, request)
26
26
  render_json({success: true})
27
27
  end
28
-
28
+
29
29
  protected
30
-
30
+
31
31
  def find_klass
32
32
  @klass = Uploader.constantize(params[:klass])
33
33
  raise ActionController::RoutingError.new("Class not found #{params[:klass]}") if @klass.nil?
@@ -35,9 +35,9 @@ module Uploader
35
35
 
36
36
  def find_asset
37
37
  @asset = @klass.where(:public_token => params[:id]).first
38
- raise ActionController::RoutingError.new("Asset not found by guid #{params[:id]}") if @asset.nil?
38
+ raise ActionController::RoutingError.new("Asset not found by guid #{params[:id]}") if @asset.nil?
39
39
  end
40
-
40
+
41
41
  def render_resourse(record, status = 200)
42
42
  if record.errors.empty?
43
43
  render_json({:files => Array.wrap(record.to_jq_upload)}, status)
@@ -45,7 +45,7 @@ module Uploader
45
45
  render_json(record.errors, 422)
46
46
  end
47
47
  end
48
-
48
+
49
49
  def render_json(hash_or_object, status = 200)
50
50
  ctype = env["HTTP_USER_AGENT"] && env["HTTP_USER_AGENT"].include?("Android") ? "text/plain" : "application/json"
51
51
 
@@ -1,3 +1,3 @@
1
1
  module Uploader
2
- VERSION = "0.10.0".freeze
2
+ VERSION = "0.10.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv-rails-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Galeta
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-11-20 00:00:00.000000000 Z
13
+ date: 2018-12-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jquery-ui-rails