seri 0.1.3 → 0.1.4

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: a02dd540adfc36c6d0f6417e4c0bd0bf887984c5bbc5ed1a402fe3aad650bfa7
4
- data.tar.gz: 9d44e8992495a476498c4bbf9c80b5f634e109e540473378a68e7c683a1e6ad7
3
+ metadata.gz: 46c74db605b3be850012902824a5e6eb8cea24840283a19c2a693b8494ab4c05
4
+ data.tar.gz: 1a5c0e021e369f0a8426a8e9295965a7c9c8e00da1b03058723c1846d9ae9a82
5
5
  SHA512:
6
- metadata.gz: 9c7f836910af0cee794b9ced85aff98a2d8c585d00f06c3e4a26992ae05c054ad384abd4673fab21883debdbc1dca684cce1a890dcfa62780fd136b4a4ae9bd5
7
- data.tar.gz: '01092c8d0e062d8b3aae34ee8897f9278b2d1bd1780e0092c9248853b08171b80b2b2043b0cff1142e416963689d24a86391700bc8fb84d77ea0679f4cf73f4f'
6
+ metadata.gz: 7b13a08781a36ed66bc7a2dc0407408a112e183c20177ef00a01509470c25e0e8bf164758e86405cd9be2828bcddd554fbfc1975f1390b774350bd1cb074e70c
7
+ data.tar.gz: '08ced2f63fcb804cba013f214284928f15a9f5ad4afbe7fd5002b4b08643908fc2bd8adcc64edf5a48831110ae313e51519cfad12a79fe589bad0e4db0d13580'
@@ -1,3 +1,3 @@
1
1
  class Serializer
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/serializer.rb CHANGED
@@ -4,7 +4,11 @@ require 'serializer/group_serializer'
4
4
  class Serializer
5
5
  class SerializerError < StandardError; end
6
6
 
7
- ARRAYS = %w(Array ActiveRecord_AssociationRelation)
7
+ ARRAYS = %w(
8
+ Array
9
+ ActiveRecord_AssociationRelation
10
+ ActiveRecord_Associations_CollectionProxy
11
+ )
8
12
 
9
13
  Attribute = Struct.new(:key, :condition, :from, :serializer, :options)
10
14
 
@@ -64,7 +68,7 @@ class Serializer
64
68
  def serialize_value(value, serializer)
65
69
  return value unless serializer
66
70
 
67
- if ARRAYS.any? { |match| match.end_with?(value.class.to_s) }
71
+ if ARRAYS.any? { |match| value.class.to_s.end_with?(match) }
68
72
  value.map { |v| serializer.new(v).to_h }
69
73
  else
70
74
  serializer.new(value).to_h
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - grdw