materialize 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/materialize/base_builder.rb +0 -1
- data/lib/materialize/entity.rb +8 -1
- data/lib/materialize/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: b2e696fa515edc7e3a9edcf0ff776ec1c68e944c
|
4
|
+
data.tar.gz: 454ef3405a70173e4abe5b74874085bafb932d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f6d558f712e14a7bbb730b23a58b59eafe65b24ae0ac9ab5ae8283b5dfe8857c1b6e89187c8a063ea14a9a9d885b7599acf103777972aea8870f0d953883079
|
7
|
+
data.tar.gz: 420a713b91d7ab819bd2a16f5ab9f96a6927235b4fda4871adadbdbc6f6f6ceaaa8ef9428793de12743bcab948bae7170fecf1464826d416608e0cc0f174781b
|
data/lib/materialize/entity.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# TODO: Write a Entity::attr_collection method that returns an empty array if not set
|
2
|
+
|
1
3
|
module Materialize
|
2
4
|
class Entity
|
3
5
|
include Utils
|
@@ -47,7 +49,12 @@ module Materialize
|
|
47
49
|
|
48
50
|
def attempt_entity_conversion(key, value)
|
49
51
|
if class_exists?(covert_to_entity_class_name(key))
|
50
|
-
Module.const_get(builder_class_name_for(key))
|
52
|
+
klass = Module.const_get(builder_class_name_for(key))
|
53
|
+
if value.is_a?(Array)
|
54
|
+
klass.build_all(value, __repo__, __options__)
|
55
|
+
else
|
56
|
+
klass.build(value, __repo__, __options__)
|
57
|
+
end
|
51
58
|
else
|
52
59
|
value
|
53
60
|
end
|
data/lib/materialize/version.rb
CHANGED