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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '04958c784b966e2b0bb05dacc8d8a1b253358596'
4
- data.tar.gz: 1f564665c929e398bd4af7eeb2cad6a906c1c805
3
+ metadata.gz: b2e696fa515edc7e3a9edcf0ff776ec1c68e944c
4
+ data.tar.gz: 454ef3405a70173e4abe5b74874085bafb932d85
5
5
  SHA512:
6
- metadata.gz: 5d1baa1ba05898ee752b17c93ffe84e7671fb3a2bdc079a4d9d1078a50747729392322bf0ac38993a9144bdfda8f7bc4981c2dbb0353d5b2bf9143f9e24361a4
7
- data.tar.gz: e76ed92f6dc1df83cd158dd7ce9078dd5ca76820bc5ced8b382d7fc7be83d6362d1d7c063fbbd5cfe3124c803a96563b38a0e9568edc0a825efa09860307cd55
6
+ metadata.gz: 2f6d558f712e14a7bbb730b23a58b59eafe65b24ae0ac9ab5ae8283b5dfe8857c1b6e89187c8a063ea14a9a9d885b7599acf103777972aea8870f0d953883079
7
+ data.tar.gz: 420a713b91d7ab819bd2a16f5ab9f96a6927235b4fda4871adadbdbc6f6f6ceaaa8ef9428793de12743bcab948bae7170fecf1464826d416608e0cc0f174781b
@@ -5,7 +5,6 @@ module Materialize
5
5
  extend Concurrent
6
6
  class << self
7
7
 
8
- # Need to attach builder info somehow before we call initialize!
9
8
  def build(data, repo, options)
10
9
  data = data.merge({ __repo__: repo, __options__: options })
11
10
  entity_class.new(data)
@@ -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)).build_all(value, __repo__, __options__)
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
@@ -1,3 +1,3 @@
1
1
  module Materialize
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: materialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Fiser