dulead-jsonapi-serializer 2.2.1 → 2.2.2

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: 604beead860bba8e8002e92f0c47903c089e66e392a2961e7b27205dc7ca255b
4
- data.tar.gz: 8cca19a6be3ffa1697b907346fa046a92bbed25163169908e9545f794fa1f05b
3
+ metadata.gz: b25b6a052fc6903eec07a319e0bd78f084d3f5751b6855048f4272595530698c
4
+ data.tar.gz: d45e2370681ff7bcd4e3dafed3ccf250a7c3bef93bef7db9f0f5b1177ca58d9d
5
5
  SHA512:
6
- metadata.gz: 3c04073da9088ef4823526830b2a12ac3a47cbdc81bdadd4fe411da3aaec715db53bd83f6e0b883539a7934940d5c6e048cec9457a82861675b2ac8fc199e471
7
- data.tar.gz: 00daee878602596954b751c4539d22cb0b4d8e1c8279ba3be06367e41b12f8fb0946d0cec96320156b99508f5df118f396825e8a0862a417fcd95850f3fa9806
6
+ metadata.gz: c0086eeceeaac064a62899540cfd615593aafb35a81dfe2e91e317d067e71bf8f4e8425fa2b4a8632ad673bd351691825cac9c3e41c5b54ab762e6589c5382f2
7
+ data.tar.gz: 190c3d2d1cf37929aa3b36a26b2e7d164f467258787caf95345d953682fab2b7e2bc805dbe83a298bcd7919e4a0f2eadea207d76ed113cdeea2f64d35b2c6ee7
@@ -220,7 +220,12 @@ module FastJsonapi
220
220
 
221
221
  # if not, use the record type of the serializer, and memoize the transformed version
222
222
  serializer = serializer_for(record, serialization_params)
223
- @record_types_for[serializer] ||= run_key_transform(serializer.record_type)
223
+ # if the serializer has record_type_block -> use it instead
224
+ if serializer.record_type_block.present?
225
+ @record_types_for[serializer] ||= serializer.record_type_block.call(record)
226
+ else
227
+ @record_types_for[serializer] ||= run_key_transform(serializer.record_type)
228
+ end
224
229
  end
225
230
 
226
231
  def compute_static_record_type
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Serializer
3
- VERSION = '2.2.1'.freeze
3
+ VERSION = '2.2.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dulead-jsonapi-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JSON:API Serializer Community
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-15 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport