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: 365c5ad54ff379fc88b5469c9933914cb1363e29
4
- data.tar.gz: 49bdb736e4b44c3577ccd1d4bad43f544ea51da0
3
+ metadata.gz: 3295adc0d84020b0fa9a08e84ddb4d180c8c6e37
4
+ data.tar.gz: 840dda8db5e411535901274306d796715a62e515
5
5
  SHA512:
6
- metadata.gz: 8ea56c760edd69d047bf871c3ba9869021f79091c916950f839e48fde1c48b23293b69af8cb7725aeac2e39b5a7f0b3fc7aa2b95639d4ab2d95afeec709c78f9
7
- data.tar.gz: 855624a60138ff7af95ff09369dcd849912f3032bd6841b9af1a7b51288f6f6a68f892670fdaf3f6533f0af77d62a352054197da47d2ca0f15b3555597717ba6
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?
@@ -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,
@@ -1,3 +1,3 @@
1
1
  module Uploadbox
2
- VERSION = "0.2.0.beta1"
2
+ VERSION = "0.2.0.beta2"
3
3
  end
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.beta1
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-02 00:00:00.000000000 Z
12
+ date: 2014-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails