avromatic 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9b086516351e441fda56c4bd8ba092e94d21138
4
- data.tar.gz: 620bfdfab8da77dd66a817cdf5735aafd6e923d2
3
+ metadata.gz: 413739978c36254c583ae736d1251f80999d28da
4
+ data.tar.gz: 8558a6bb564d275cc8f63b2e8480893d49db5267
5
5
  SHA512:
6
- metadata.gz: 2dde2fdc32aa7b2e9c133ff38e955900ea60a53d484e001488c8d5cc96baf2a767a0ec2776b0992290215eb896e408b8809f5cef1bc727daa9611e45bd7740a6
7
- data.tar.gz: 51a66b71eda6f2e16175c6d92875ffc3a7ed43e8195987db913bee3e2e98b1ecba51e4848e682f2c14a93414e8566a3ce806684b7aca2900a225ef4beb98dfc2
6
+ metadata.gz: 22be0967a00f55feb617dd3f15ad91e637d060aebac5fb5b0034f82de452546feb08ec1e2ba0ac1d0d3cd99e5645cbccde58bbd5f1ce7cde46f53eb86387d8d8
7
+ data.tar.gz: 938539514b19b347a4b3b983c09ff5cadb4f9a21d2920c4572f082db7be11e96fb5cc4deca21464c074c7e5bd9beedbd2d7387b6ca69a2a9351b99032afc8a8e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # avromatic changelog
2
2
 
3
+ ## v0.11.2
4
+ - Fix for models containing optional array and map fields.
5
+
3
6
  ## v0.11.1
4
7
  - Another fix for Rails initialization and reloading. Do not clear the nested
5
8
  models registry the first time that the `to_prepare` hook is called.
@@ -27,7 +27,7 @@ module Avromatic
27
27
  def fetch(object, field_class = nil)
28
28
  field_type = object.is_a?(Avro::Schema::Field) ? object.type : object
29
29
 
30
- if field_class && field_type.type_sym == :union && !(field_class < Avromatic::Model::AttributeType::Union)
30
+ if field_class && field_type.type_sym == :union && !union_attribute?(field_class)
31
31
  field_type = Avromatic::Model::Attributes.first_union_schema(field_type)
32
32
  end
33
33
 
@@ -38,6 +38,13 @@ module Avromatic
38
38
  private
39
39
 
40
40
  attr_reader :custom_types
41
+
42
+ # The type that is used to define a Virtus attribute may be a Class or
43
+ # for an array or map field it may be an instance of an Array or Hash.
44
+ # This method safely checks if a Union class has been selected.
45
+ def union_attribute?(attribute_type)
46
+ attribute_type.is_a?(Class) && attribute_type < Avromatic::Model::AttributeType::Union
47
+ end
41
48
  end
42
49
  end
43
50
  end
@@ -1,3 +1,3 @@
1
1
  module Avromatic
2
- VERSION = '0.11.1'.freeze
2
+ VERSION = '0.11.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avromatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2016-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro