gleborator 0.1.1.7 → 0.1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gleborator/setup.rb +16 -13
- data/lib/gleborator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94ffe24be5917fadd0306a1f30a9e13b7863bff2
|
4
|
+
data.tar.gz: 6df36b9c9305db217456e938054a1bc1e82539d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0328f12583786884d1d6edc54f5544d2c700ab4c30018d6d1f663b81e268b16a390b493504ad1262dec61ce2a76592c1873928b183a830edba4f34dd81762dbe
|
7
|
+
data.tar.gz: 534ce1a9125fcd250ae3f11b003f013b690de42bc7ab7345a9c332dd32969dcbc98df19fff051561d9399d76137fc2b31ca3260bb6344f06c51d84e4fddb146f
|
data/lib/gleborator/setup.rb
CHANGED
@@ -3,23 +3,26 @@ module Gleborator
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
def decorate
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
6
|
+
decorator_class.new(self)
|
7
|
+
end
|
8
|
+
|
9
|
+
def decorator_class
|
10
|
+
self.class.decorator_class
|
12
11
|
end
|
13
12
|
|
14
13
|
module ClassMethods
|
15
14
|
def decorate
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
decorator_class.decorate_collection all
|
16
|
+
end
|
17
|
+
|
18
|
+
def decorator_class
|
19
|
+
begin
|
20
|
+
prefix = respond_to?(:model_name) ? model_name : name
|
21
|
+
decorator_name = "#{prefix}Decorator"
|
22
|
+
decorator_name.constantize
|
23
|
+
rescue NameError => e
|
24
|
+
raise "Couldn't find decorator #{decorator_name}"
|
25
|
+
end
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
data/lib/gleborator/version.rb
CHANGED