material 0.2.19 → 0.2.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/material/concerns/components.rb +2 -1
- data/lib/material/concerns/site.rb +5 -1
- data/lib/material/list.rb +8 -0
- data/lib/material/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a4791e4e4d226abbbecb0820ee50ef195cc11eefb7eed6574e82d00672f60f0
|
4
|
+
data.tar.gz: 837bdee1cfa4e8ad7c24f97434ffe908d8139951eee655deaec63eb9c1ea9011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c5271b33081010631cbc08138353a5ec112ea5f81eb2aad680edcf635008869c9481e7b071406fedfd60b49281f9eefc885c092c9965282337611930510db5
|
7
|
+
data.tar.gz: be8ba2fa048adf65af6c78e30539da5c162a1ff562df03b4d636967eee0199928f3c38b7e39c017afe1762843e36d969855880cb545204f753682e07ec10285a
|
@@ -61,7 +61,8 @@ module Material
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def value_for(object)
|
64
|
-
object.instance_eval(&@value)
|
64
|
+
value = object.instance_eval(&@value) if @value.respond_to?(:call)
|
65
|
+
value.is_a?(Class) ? value : value.dup if value.present?
|
65
66
|
end
|
66
67
|
|
67
68
|
def configure(**opts, &block)
|
@@ -5,7 +5,7 @@ module Material
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
register_component
|
8
|
+
register_component(:parent) { default_parent }
|
9
9
|
register_component :filter
|
10
10
|
register_component :filter_default
|
11
11
|
register_path_component(:path, :singular_route_key)
|
@@ -27,5 +27,9 @@ module Material
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
def default_parent
|
32
|
+
nil
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
data/lib/material/list.rb
CHANGED
@@ -19,6 +19,14 @@ module Material
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
def contextualize(parent)
|
23
|
+
@context_parent = parent
|
24
|
+
end
|
25
|
+
|
26
|
+
def default_parent
|
27
|
+
@context_parent
|
28
|
+
end
|
29
|
+
|
22
30
|
def default_title
|
23
31
|
(item_class.try(:model_name)&.human || item_class&.name).pluralize || self.class.name
|
24
32
|
end
|
data/lib/material/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Garside
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|