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 +4 -4
- data/lib/jsonapi/resource.rb +4 -2
- data/lib/jsonapi/resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc4d9609ab4583905bdd873a5441c18b61070815
|
4
|
+
data.tar.gz: 77f715f9ae01ace74fb4b806e72958f7aa63c7af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 597b6fa8abcb568db3220f549f02bfce0be036668adcd4174a114eaa28d8ea44eb83d5c9478f87934adfe7d3c1b1bfad08432927e4817dbd7481bdbfb2cc555b
|
7
|
+
data.tar.gz: 5cb094596df3b6977981de5c8bdecaf95b70a62a3db475d40b9d92f35599325a62ef812801c1f57557a7562e9287c427121db2ab703403b6558ba28195f50057
|
data/lib/jsonapi/resource.rb
CHANGED
@@ -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.
|
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
|
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.
|
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-
|
12
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|