snaptable 2.2.3 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snaptable/constructor/renderer.rb +9 -1
- data/lib/snaptable/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: 116494e78d771e3bfc4e6e354a11dc0b96cd4da7b265135f4382c00a204c4cc1
|
4
|
+
data.tar.gz: 1978b61ee80c3405e2075b2f4f69a533218b2112e44e74bed0343c4f7a2c2907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56b0ef96cae11ce4f2c485fef01185a962881f33054d783d273b4f8c953738a41c69bd29a33c24e9bcb90dc0a01c6d247e4063a8bc9dba29137dd5d731e1807e
|
7
|
+
data.tar.gz: 248667837e08cea9bb4748c8fc633c8cb798bce2f6efcb9d45ba8a1ac6313fb5dfbd4e33074b8bce2518e387fba48419c38e31c95a57fa2bd96c4d210f46145b
|
@@ -32,7 +32,7 @@ module Snaptable
|
|
32
32
|
attr_value = element.send(attribute)
|
33
33
|
else # a hash { model: :attribute }
|
34
34
|
attr_value = element.send(attribute.keys[0]).send(attribute.values[0])
|
35
|
-
attr_model = attribute.keys[0].to_s
|
35
|
+
attr_model = string_to_class(attribute.keys[0].to_s)
|
36
36
|
attribute = attribute.values[0]
|
37
37
|
end
|
38
38
|
format(attribute, attr_value, attr_model)
|
@@ -55,6 +55,14 @@ module Snaptable
|
|
55
55
|
model.defined_enums.keys
|
56
56
|
end
|
57
57
|
|
58
|
+
def string_to_class(string)
|
59
|
+
begin
|
60
|
+
return string.classify.constantize
|
61
|
+
rescue NameError
|
62
|
+
return nil
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
58
66
|
end
|
59
67
|
end
|
60
68
|
end
|
data/lib/snaptable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khcr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|