uploadbox 0.2.0.beta1 → 0.2.0.beta2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3295adc0d84020b0fa9a08e84ddb4d180c8c6e37
|
4
|
+
data.tar.gz: 840dda8db5e411535901274306d796715a62e515
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 608fe895c9d1c576a60537c936d5beb3c358deab7abb0d31a5cfaca589c5c62f811385842d4c5085dc4fb19004e8a157c2d12f9e309816722c5586a99882eee7
|
7
|
+
data.tar.gz: e0792f3cbdb7749b1e0b66e367e80822d6de790454f820134e0e6e72360122182cfc34f00de02917af0c958825d80a86b36e6537bd8b4f6e9a9b98a4f4e21770
|
@@ -22,7 +22,7 @@
|
|
22
22
|
input type="hidden" name="acl" value="public-read"
|
23
23
|
input type="hidden" name="key"
|
24
24
|
|
25
|
-
input type="hidden" name="image[imageable_type]" value="#{resource.class}"
|
25
|
+
input type="hidden" name="image[imageable_type]" value="#{resource.class.base_class}"
|
26
26
|
input type="hidden" name="image[upload_name]" value="#{upload_name}"
|
27
27
|
- if removable
|
28
28
|
- if resource.send(upload_name).present?
|
@@ -26,7 +26,7 @@
|
|
26
26
|
input type="hidden" name="acl" value="public-read"
|
27
27
|
input type="hidden" name="key" value="uploads/#{secure_random}/"
|
28
28
|
|
29
|
-
input type="hidden" name="image[imageable_type]" value="#{resource.class}"
|
29
|
+
input type="hidden" name="image[imageable_type]" value="#{resource.class.base_class}"
|
30
30
|
input type="hidden" name="image[upload_name]" value="#{upload_name}"
|
31
31
|
- if removable
|
32
32
|
- if resource.send(upload_name).present?
|
data/lib/uploadbox/engine.rb
CHANGED
@@ -10,6 +10,13 @@ require 'resque'
|
|
10
10
|
require 'heroku_resque_auto_scale'
|
11
11
|
require 'dotenv-rails'
|
12
12
|
|
13
|
+
# Allows redirects from https to http as facebook does
|
14
|
+
module OpenURI
|
15
|
+
def self.redirectable?(uri1,uri2)
|
16
|
+
uri1.scheme.downcase == uri2.scheme.downcase || (/\A(?:https?|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
13
20
|
module Uploadbox
|
14
21
|
class Engine < ::Rails::Engine
|
15
22
|
config.generators do |g|
|
@@ -30,7 +37,7 @@ end
|
|
30
37
|
|
31
38
|
class ActionView::Helpers::FormBuilder
|
32
39
|
def uploads_one(upload_name, options={})
|
33
|
-
upload_model_class = "Uploadbox::#{@object.class.to_s + upload_name.to_s.camelize}".constantize
|
40
|
+
upload_model_class = "Uploadbox::#{@object.class.base_class.to_s + upload_name.to_s.camelize}".constantize
|
34
41
|
options.reverse_merge!(preview: upload_model_class.versions.keys.first,
|
35
42
|
namespace: false,
|
36
43
|
default: false,
|
@@ -55,7 +62,7 @@ class ActionView::Helpers::FormBuilder
|
|
55
62
|
end
|
56
63
|
|
57
64
|
def uploads_many(upload_name, options={})
|
58
|
-
upload_model_class = "Uploadbox::#{@object.class.to_s + upload_name.to_s.camelize}".constantize
|
65
|
+
upload_model_class = "Uploadbox::#{@object.class.base_class.to_s + upload_name.to_s.camelize}".constantize
|
59
66
|
options.reverse_merge!(preview: upload_model_class.versions.keys.first,
|
60
67
|
namespace: false,
|
61
68
|
default: false,
|
data/lib/uploadbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uploadbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julio Protzek
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|