effective_assets 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/acts_as_asset_box.rb +3 -7
- data/lib/effective_assets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44f1e683151eec235827918b34aa5e7838c9f34c
|
4
|
+
data.tar.gz: 6c56629f8ffd2f21fd0ea90ab3700c442e064ec7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aa8570ae9ea214a33570d69df27c4e57eb2be191a21913c5e90007b6a3cd24b7cfdf5695336898afd9520d874115f6ea17960b057f3a443bafa07d940a4addb
|
7
|
+
data.tar.gz: 437d63f81b740e9aec43256bc547db4c41bc4cee56ea808e4659e2d0699113c006cd4667430af4f7981bbcf7c1730b459fa51cf70d732eeb5106d5b603f4f0e5
|
@@ -45,7 +45,7 @@ module ActsAsAssetBox
|
|
45
45
|
boxes = boxes.first
|
46
46
|
|
47
47
|
boxes.each do |box, validation|
|
48
|
-
self.send(:define_method, box) {
|
48
|
+
self.send(:define_method, box) { effective_assets(box) }
|
49
49
|
|
50
50
|
if validation == true
|
51
51
|
validates box, :asset_box_presence => true
|
@@ -55,7 +55,7 @@ module ActsAsAssetBox
|
|
55
55
|
end
|
56
56
|
else
|
57
57
|
boxes.each do |key|
|
58
|
-
self.send(:define_method, key) {
|
58
|
+
self.send(:define_method, key) { effective_assets(key) }
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -78,7 +78,7 @@ module ActsAsAssetBox
|
|
78
78
|
module ClassMethods
|
79
79
|
end
|
80
80
|
|
81
|
-
def
|
81
|
+
def effective_assets(box = nil)
|
82
82
|
box = (box.present? ? box.to_s : 'assets')
|
83
83
|
boxes = box.pluralize
|
84
84
|
|
@@ -89,10 +89,6 @@ module ActsAsAssetBox
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
def asset
|
93
|
-
assets(:asset)
|
94
|
-
end
|
95
|
-
|
96
92
|
# This method can be used to manually link an asset to an acts_as_asset_box
|
97
93
|
# object in tests or otherwise. The object needs to be saved afterward so
|
98
94
|
# that the Effective::Attachment is saved (and the association is saved).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|