jsonapi-resources 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jsonapi/resource.rb +4 -2
- data/lib/jsonapi/resources/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c188b1a5be92d5d073582f61ccf9b049ba9c2d
|
4
|
+
data.tar.gz: 13deeb24963ef64adc49b53562851119411e1b56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e261dde48fdd2f2b0697d9e5ef8bf13087880e508f2692b3c562b84bc357f08c4b524c1de51bc724fd2462aa30eb6cec90d2217933fe2f9212bb598ec395414b
|
7
|
+
data.tar.gz: f04daba00e00099cb4bc22d197664f8bcbdd29ab5fec8ac9ae0873b400c732de50373d6ed7fc31a96edceda6cd42ee9eb1f5523dc7b1d42e9822e73f16f34b42
|
data/lib/jsonapi/resource.rb
CHANGED
@@ -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.
|
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
|