jsonapi-resources 0.9.0.beta2 → 0.9.0.beta3

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: 9c91584cb821e922ce02a4189ccfc12ef3d12bf2
4
- data.tar.gz: f34cf0140439709e7a1a00ec4f260149be82a2e3
3
+ metadata.gz: fc4d9609ab4583905bdd873a5441c18b61070815
4
+ data.tar.gz: 77f715f9ae01ace74fb4b806e72958f7aa63c7af
5
5
  SHA512:
6
- metadata.gz: e2bdc4761db8f0369e4e2ed10b4ceef5c1d1b8e3bccf01aa5c3361f7d511d26a7a24e7ba7577eee775dd821eeeb872fc854724577b5bdec5d90a006549e852ad
7
- data.tar.gz: b3760dce9fbeac74f8089d3611ff4537a36689169d37b1f1f8820d21a0dbe6db856892fbf0c32e08c59ba374762b5a7727ed880a00e618eaeb8845e188259731
6
+ metadata.gz: 597b6fa8abcb568db3220f549f02bfce0be036668adcd4174a114eaa28d8ea44eb83d5c9478f87934adfe7d3c1b1bfad08432927e4817dbd7481bdbfb2cc555b
7
+ data.tar.gz: 5cb094596df3b6977981de5c8bdecaf95b70a62a3db475d40b9d92f35599325a62ef812801c1f57557a7562e9287c427121db2ab703403b6558ba28195f50057
@@ -430,7 +430,9 @@ module JSONAPI
430
430
  type = subclass.name.demodulize.sub(/Resource$/, '').underscore
431
431
  subclass._type = type.pluralize.to_sym
432
432
 
433
- subclass.attribute :id, format: :id
433
+ unless subclass._attributes[:id]
434
+ subclass.attribute :id, format: :id
435
+ end
434
436
 
435
437
  check_reserved_resource_name(subclass._type, subclass.name)
436
438
  end
@@ -598,7 +600,7 @@ module JSONAPI
598
600
 
599
601
  # Override in your resource to filter the creatable keys
600
602
  def creatable_fields(_context = nil)
601
- _updatable_relationships | _attributes.keys
603
+ _updatable_relationships | _attributes.keys - [:id]
602
604
  end
603
605
 
604
606
  # Override in your resource to filter the sortable keys
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.9.0.beta2'
3
+ VERSION = '0.9.0.beta3'
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.9.0.beta2
4
+ version: 0.9.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gebhardt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-17 00:00:00.000000000 Z
12
+ date: 2017-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler