jsonapi_parameters 0.3.3 → 0.4.3

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: fd088c3d78576a1a35f884af0a1ce64e8a9616c50038e6fac7ad64dee1cac3de
4
- data.tar.gz: 8b1e5a6fe237922ababfd50c0d51e50c039a42c1fc0750af2972a631b73bf13e
3
+ metadata.gz: 2a339d9b7223b9c6d96f89b3717c0dd6d2498bcb8d9af26cc332a3e34ec56223
4
+ data.tar.gz: df89b0788c62e1e70881f87164af344325713778d0e318087464ae842762ed45
5
5
  SHA512:
6
- metadata.gz: 15cd4a6231720e0bc2d34b83e531a5bec95610638e5f3af80815730c5e414b2b9a22ea12c64685cf30698eae6899ba35dbf241b718f58dfedda5603dc4b97cf5
7
- data.tar.gz: 3a6b5ebfa7562b27a34779f8db849dcf3233b9739112b02d71384a05af178eb1dc7392456db2ea4fc808348a0b6f6e4f63a4329df002f305b899c4b1e0c6c8ec
6
+ metadata.gz: 4347b54d8f0950cb04e10ab0f1fbc4ca34864f22169914f25069cf31170471a7e4efd4d218be7e72b2efa0055c93ce1f859026736e719f37dfd9683a79af9d3e
7
+ data.tar.gz: 3555976c98bfab57d81b227844b1c7a7a359b73a02833db1496ba8177ac8e78825ec69f13bace62249ae165f5803ad9f5e8aca18320674fe50b4b4f09d5f1b88
@@ -51,7 +51,11 @@ module JsonApi::Parameters
51
51
  end
52
52
 
53
53
  def jsonapi_unsafe_params
54
- @jsonapi_unsafe_params ||= @jsonapi_unsafe_hash.dig(:data, :attributes) || {}
54
+ @jsonapi_unsafe_params ||= (@jsonapi_unsafe_hash.dig(:data, :attributes) || {}).tap do |param|
55
+ id = @jsonapi_unsafe_hash.dig(:data, :id)
56
+
57
+ param[:id] = id if id.present?
58
+ end
55
59
  end
56
60
 
57
61
  def jsonapi_included
@@ -1,5 +1,5 @@
1
1
  module JsonApi
2
2
  module Parameters
3
- VERSION = '0.3.3'.freeze
3
+ VERSION = '0.4.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_parameters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Visuality
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-21 00:00:00.000000000 Z
12
+ date: 2019-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -207,6 +207,20 @@ dependencies:
207
207
  - - "~>"
208
208
  - !ruby/object:Gem::Version
209
209
  version: '1.5'
210
+ - !ruby/object:Gem::Dependency
211
+ name: loofah
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - "~>"
215
+ - !ruby/object:Gem::Version
216
+ version: 2.3.1
217
+ type: :development
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - "~>"
222
+ - !ruby/object:Gem::Version
223
+ version: 2.3.1
210
224
  - !ruby/object:Gem::Dependency
211
225
  name: factory_bot
212
226
  requirement: !ruby/object:Gem::Requirement
@@ -277,6 +291,20 @@ dependencies:
277
291
  - - "~>"
278
292
  - !ruby/object:Gem::Version
279
293
  version: 0.4.2
294
+ - !ruby/object:Gem::Dependency
295
+ name: sprockets
296
+ requirement: !ruby/object:Gem::Requirement
297
+ requirements:
298
+ - - "<"
299
+ - !ruby/object:Gem::Version
300
+ version: '4'
301
+ type: :development
302
+ prerelease: false
303
+ version_requirements: !ruby/object:Gem::Requirement
304
+ requirements:
305
+ - - "<"
306
+ - !ruby/object:Gem::Version
307
+ version: '4'
280
308
  description: JsonApi::Parameters allows you to easily translate JSON:API compliant
281
309
  parameters to a structure expected by Rails.
282
310
  email: