fields-serializer 0.5.0 → 0.5.1

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: d97826f68957ac11395bfc95787ebc4562a49891
4
- data.tar.gz: dba35d1851970293eb3fcf3ac8992cb8108bc801
3
+ metadata.gz: 0af68b7e1a60e29c296ba12e1666674bcc5149ba
4
+ data.tar.gz: efdb03cd8528cba02376024017934c6caecf89ca
5
5
  SHA512:
6
- metadata.gz: 429db7023534cb8168d610708cca7705a3ec3127da0d390d2472b989f0645071f63907c3c21fc12990bacd10bea1c0e29c7535f8e774e2f680c4dbb150594818
7
- data.tar.gz: 2a2b8473e52a57245db3333d18603bd759c094917a484391476c47e49de1ca70424e1ec3d6e739d55a34c659dccbfbca181d8e9646fc53d84597378ffd694569
6
+ metadata.gz: d016317bb15e802fe1479c947d3adee11274db5c5792d023fa7000a0a9e2c69c8ef35eee5da854557796a531ed5d29651872f4098b6c13fee646713bd3799ac6
7
+ data.tar.gz: 3d1dd09c083f36a393d5ff6232b5318048c16554c2cef40ed607d01de8d8a88133476ba73b2b51d3d8664d1170504e577e4adff857e471cb1665c8b106a1a031
@@ -23,12 +23,13 @@ module Fields
23
23
  end
24
24
 
25
25
  def create_serializer_class(fields)
26
+ klass = self
26
27
  Class.new(ActiveModel::Serializer) do
27
28
  Array(fields).each do |field|
28
29
  if field.kind_of?(Hash)
29
- nested_association(field)
30
+ klass.nested_association(field)
30
31
  else
31
- attribute field.to_sym unless association?(field)
32
+ attribute field.to_sym unless klass.association?(field)
32
33
  end
33
34
  end
34
35
  end
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fields-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery