ializer 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 23ed07c07fd66ea5e3e8a7fdf7b5704264b1d030d7bf80a8146ae198d97f6ff4
4
- data.tar.gz: 64252cc08dd94f2f7655f0889c44e6e8302b16644b178207b4a1c00cfec8ffa3
3
+ metadata.gz: '086b2c8ab6cf0a932aa88a21336a776acc21df97cf2bfebba2d0c88bb7c9c0ac'
4
+ data.tar.gz: 740fd2f601120118916917fed867b3427ec9707835450221b81758d47bade5cc
5
5
  SHA512:
6
- metadata.gz: 0a8f637568a675eb6889c14d9ecb0874a633572fbb076326ae9f283f89c53e1720d89a595cb37c7f965c8c9699c3f8f2dec80a28162c140e21f57d3b71d56bba
7
- data.tar.gz: 7602fa5387d2230097bdfc844d746742702f7f4032b8f9bfaf1ba2c4a545b51b798f85798be94acce7cb97ccde401f420154f82e9ee99cb3ae6e2aa21e74b08c
6
+ metadata.gz: 86005ca1dbe5ad262ecd4a0347406a39e2ce305806991efc122390021683541504120c37b740515459f89cc17b9dde63aceb4149f355ce998da4546b87140fb5
7
+ data.tar.gz: c41e6d19fc25aa1f1704a51219d4a036d0df8579c6893024e1c6714b43c61c7da23580f2e487e720ac3cfd8aaca6511629bc4ecccb563bb720f0c50f00635b0e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ializer
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -38,6 +38,8 @@ module Ser
38
38
  def serialize(object, context = nil)
39
39
  return serialize_one(object, context) unless valid_enumerable?(object)
40
40
 
41
+ return [] if object.empty?
42
+
41
43
  object.map { |o| serialize_one(o, context) }
42
44
  end
43
45
 
@@ -129,6 +131,8 @@ module Ser
129
131
 
130
132
  return field.serialize(value, context) unless valid_enumerable?(value)
131
133
 
134
+ return nil if value.empty?
135
+
132
136
  value.map { |v| field.serialize(v, context) }
133
137
  end
134
138
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Steinberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-14 00:00:00.000000000 Z
11
+ date: 2020-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport