fields-serializer 0.5.1 → 0.5.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: 0af68b7e1a60e29c296ba12e1666674bcc5149ba
4
- data.tar.gz: efdb03cd8528cba02376024017934c6caecf89ca
3
+ metadata.gz: 443eca2a66daab0162582536e8326a7d5b7b3c97
4
+ data.tar.gz: 81f71c018cc3c5f07a4937a59db442ad53822996
5
5
  SHA512:
6
- metadata.gz: d016317bb15e802fe1479c947d3adee11274db5c5792d023fa7000a0a9e2c69c8ef35eee5da854557796a531ed5d29651872f4098b6c13fee646713bd3799ac6
7
- data.tar.gz: 3d1dd09c083f36a393d5ff6232b5318048c16554c2cef40ed607d01de8d8a88133476ba73b2b51d3d8664d1170504e577e4adff857e471cb1665c8b106a1a031
6
+ metadata.gz: 20b507a9cb95489b542cef6603e328749e85e415af3ba36fd85836810061cec9e21443a88627399ecc1f9c3676078a9721d6931da0fd4ab0d1b5808feca422a8
7
+ data.tar.gz: 9a2f3c2dd43ca801ee951012a455fa441c2d3d3b615fa64d1c0e270f9795cface7a96a95ee067255ee6d094319e8c17cd2ed5613f2e9b4b1f2424c05eefcc4f9
@@ -7,6 +7,11 @@ module Fields
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  class_methods do
10
+
11
+ def association?(key)
12
+ reflections.keys.include?(key)
13
+ end
14
+
10
15
  # Convert a list of fields (json_api notation) in a list of associations to be
11
16
  # added to a ActiveRecord Model.includes call
12
17
  #
@@ -58,10 +63,6 @@ module Fields
58
63
  def array_fields(fields)
59
64
  Array(fields).map { |str| str.to_s.split(",").map(&:strip) }.flatten.sort
60
65
  end
61
-
62
- def association?(key)
63
- reflections.keys.include?(key)
64
- end
65
66
  end
66
67
  end
67
68
  end
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.5.1"
3
+ VERSION = "0.5.2"
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.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery