jsonapi-resources 0.8.2 → 0.8.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
  SHA1:
3
- metadata.gz: 0c2c5b5766663832a646cbfe1437433e50781972
4
- data.tar.gz: 2b656ca460394882492d159ba4b4bc342fd9b009
3
+ metadata.gz: e5c188b1a5be92d5d073582f61ccf9b049ba9c2d
4
+ data.tar.gz: 13deeb24963ef64adc49b53562851119411e1b56
5
5
  SHA512:
6
- metadata.gz: 402ee848c09cae27b94b8358be89c24c70aa2eb79ed82e5627786ad0eeba29054af6197b67270afd41425d0117b8506908bb1a3d1d60acaf492964505500a20c
7
- data.tar.gz: 5b857dc06609c8cf054fc09f6c04c268041366dc4b43bd9414e1d43134f0a30ce7bdf6ca718b529133613dd571ee908bb5eb975df7f87a2232fa1200bd1f41d8
6
+ metadata.gz: e261dde48fdd2f2b0697d9e5ef8bf13087880e508f2692b3c562b84bc357f08c4b524c1de51bc724fd2462aa30eb6cec90d2217933fe2f9212bb598ec395414b
7
+ data.tar.gz: f04daba00e00099cb4bc22d197664f8bcbdd29ab5fec8ac9ae0873b400c732de50373d6ed7fc31a96edceda6cd42ee9eb1f5523dc7b1d42e9822e73f16f34b42
@@ -417,7 +417,9 @@ module JSONAPI
417
417
  type = subclass.name.demodulize.sub(/Resource$/, '').underscore
418
418
  subclass._type = type.pluralize.to_sym
419
419
 
420
- subclass.attribute :id, format: :id
420
+ unless subclass._attributes[:id]
421
+ subclass.attribute :id, format: :id
422
+ end
421
423
 
422
424
  check_reserved_resource_name(subclass._type, subclass.name)
423
425
  end
@@ -579,7 +581,7 @@ module JSONAPI
579
581
 
580
582
  # Override in your resource to filter the creatable keys
581
583
  def creatable_fields(_context = nil)
582
- _updatable_relationships | _attributes.keys
584
+ _updatable_relationships | _attributes.keys - [:id]
583
585
  end
584
586
 
585
587
  # Override in your resource to filter the sortable keys
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.8.2'
3
+ VERSION = '0.8.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gebhardt