paperclip-eitheror 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paperclip/eitheror/version.rb +1 -1
- data/lib/paperclip/storage/eitheror.rb +11 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30eaf33665bded688d140b411866ebd3e8001cd4
|
4
|
+
data.tar.gz: e9bd11dfcc2c6d3ee834cdda13fc81e524b18cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbcc67e71153a54d4823056d473cdc145152f5351b6f0f4664ada122ed1c9d3067a8ff6c7e5eadedfd769576e286a324d02642d5a71d3158b9676cf78cf1e7f9
|
7
|
+
data.tar.gz: 0e75e76b3e57bc0c78dd1165cbed4921648106f85899c8d32db2194de9c5bf5ae351d084792339702e2f7ce8703d5daecd7172d82a532396ba7338cadd1ad4c2
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Paperclip
|
2
2
|
module Storage
|
3
3
|
module Eitheror
|
4
|
-
def self.extended
|
4
|
+
def self.extended(base)
|
5
5
|
base.instance_eval do
|
6
6
|
base.options[:either][:enabled] = true if base.options[:either][:enabled].nil?
|
7
7
|
@either = Attachment.new(base.name, base.instance, base.options.merge(base.options[:either]))
|
@@ -65,7 +65,17 @@ module Paperclip
|
|
65
65
|
usable_storage.send(method, *args)
|
66
66
|
end
|
67
67
|
|
68
|
+
def either_enabled?
|
69
|
+
callable_option(@either, :enabled)
|
70
|
+
end
|
71
|
+
|
68
72
|
private
|
73
|
+
|
74
|
+
def callable_option(attachment, key)
|
75
|
+
option = attachment.options[key]
|
76
|
+
option.respond_to?(:call) ? option.call(attachment) : option
|
77
|
+
end
|
78
|
+
|
69
79
|
def all_storages
|
70
80
|
[@either, @or]
|
71
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-eitheror
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matheus Abegg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.4.
|
150
|
+
rubygems_version: 2.4.5.1
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Storage for Paperclip which will fallback in case of a file not existing
|