enumbler 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/enumbler/enabler.rb +14 -7
- data/lib/enumbler/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: 55e4caeaa0c8dc41e011352ed5931651f3f74d203f54a2a747034c384d065aea
|
4
|
+
data.tar.gz: 6e772d0c3b1c8c1403298ac244a3aad601d8150497a2a76ca924f2bfecc4a661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2312aec90691d56a46e99a89706eca87f82a7b4fd4e9a319e30486daad09554a41d1d40b8daf855fb099d23a4e371a276b94b53d225d782bdd6b1a912845bff
|
7
|
+
data.tar.gz: 85508fb5286ab683ca10b9ffde36133d52780d5d66cbff40f59ce6b86ef191a7c63f18b6a398a8981f21614e77804c744af7e7efc7853437329d2759ed712011
|
data/Gemfile.lock
CHANGED
data/lib/enumbler/enabler.rb
CHANGED
@@ -17,22 +17,29 @@ module Enumbler
|
|
17
17
|
@enumble
|
18
18
|
end
|
19
19
|
|
20
|
+
# The enumble graphql_enum if it exists.
|
21
|
+
# @return [Symbol]
|
22
|
+
def to_graphql_enum
|
23
|
+
to_enumble_attribute(:graphql_enum) || super
|
24
|
+
end
|
25
|
+
|
20
26
|
# The enumble label if it exists.
|
21
27
|
# @return [String]
|
22
28
|
def to_s
|
23
|
-
|
24
|
-
return enumble.label if enumble.present?
|
25
|
-
|
26
|
-
super
|
29
|
+
to_enumble_attribute(:label) || super
|
27
30
|
end
|
28
31
|
|
29
32
|
# The enumble symbol if it exists.
|
30
33
|
# @return [Symbol]
|
31
34
|
def to_sym
|
32
|
-
|
33
|
-
|
35
|
+
to_enumble_attribute(:enum) || super
|
36
|
+
end
|
34
37
|
|
35
|
-
|
38
|
+
private
|
39
|
+
|
40
|
+
def to_enumble_attribute(attribute)
|
41
|
+
enumble = self.class.find_enumble(id)
|
42
|
+
return enumble.send(attribute) if enumble.present?
|
36
43
|
end
|
37
44
|
|
38
45
|
# These ClassMethods can be included in any model that you wish to
|
data/lib/enumbler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damon Timm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|