fields-serializer 0.5.4 → 0.5.5

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: f58ea79f6c7effc2916fafb4cdc17418f53fb354
4
- data.tar.gz: 04762f95b4d3d70f417b18879230a6274f4e2693
3
+ metadata.gz: 14864911634018953648d46bb7de53d45fa44ffb
4
+ data.tar.gz: c8cc5a14237b596c77f767e524052d785e687197
5
5
  SHA512:
6
- metadata.gz: 8fb8c055726ff3547f25260bf50a1c345b1d1a8a06df6c4df87e5ed0ebe68929f2978424f238896c0168e9b4ee7adba3980f1b642fe89b677a740d28af6cf0d9
7
- data.tar.gz: 66a7f6a69d6d1a48f4606ca5dfaf9708cf867af8d488d68f71858c6f62983f80b2c42a78dfa99d263a1fb251871275769499c5d7705878aad0b86050532678d5
6
+ metadata.gz: 6447b1f1742248a8c2ab08dbbef47242f70002a27ea5283446244f8e7e15b33d3a96e100f9ac41552f33e8063792141f734151d8f850eb03167efd7972098639
7
+ data.tar.gz: 9f2d6ba4140d85b0afab1b188cc1bc069d5b871e94b0636b04e4a3b6b2a4e5b4c5f376cc35f61bf8dfa76ec5f566238902685406c6c54cdf622fad313abee7e1
@@ -29,12 +29,14 @@ module Fields
29
29
 
30
30
  def create_serializer_class(fields)
31
31
  klass = self
32
- Class.new(ActiveModel::Serializer).class_eval do
33
- Array(fields).each do |field|
34
- if field.kind_of?(Hash)
35
- klass.send(:nested_association, field)
36
- else
37
- attribute field.to_sym unless klass.association?(field)
32
+ Class.new(ActiveModel::Serializer).tap do |new_class|
33
+ new_class.class_eval do
34
+ Array(fields).each do |field|
35
+ if field.kind_of?(Hash)
36
+ klass.send(:nested_association, field)
37
+ else
38
+ attribute field.to_sym unless klass.association?(field)
39
+ end
38
40
  end
39
41
  end
40
42
  end
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.5.4"
3
+ VERSION = "0.5.5"
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.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery