jsonapi-params 0.1.1 → 0.1.2
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/CHANGELOG.md +6 -2
- data/lib/jsonapi-params/param.rb +2 -2
- data/lib/jsonapi-params/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: de9116b1bef0c70f1bb9f7212643d3cc3e5f0604
|
|
4
|
+
data.tar.gz: 12a615d655fc3c48f83e6b76da34c5a5a6553291
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: feb7542e2522a61504eb40864eae68bff92326ae1c6cdb342ed6dce963be259042e29e0abef51c4a36e4f226998b4723632d70e66312900633a7b3ba6ec26b9b
|
|
7
|
+
data.tar.gz: 3648e73135005676a49c36d65910b6312cf012530d79b3e83139b43f2d1108c6fe405c6c1fa52865e99510d0fe450126a384bf06d88bddaec587cc15489e03bb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
* Fix attributes and relationships to force convert rails parameters to a hash.
|
|
6
|
+
|
|
3
7
|
## 0.1.1
|
|
4
8
|
|
|
5
|
-
* Change attributes and relationships to allow underscore and dasherize values
|
|
9
|
+
* Change attributes and relationships to allow underscore and dasherize values.
|
|
6
10
|
|
|
7
11
|
## 0.1.0
|
|
8
12
|
|
|
9
|
-
* Initial version with attributes and relationships
|
|
13
|
+
* Initial version with attributes and relationships.
|
data/lib/jsonapi-params/param.rb
CHANGED
|
@@ -83,7 +83,7 @@ module JSONAPI
|
|
|
83
83
|
attributes = attributes.slice(*self.class.whitelist_attributes)
|
|
84
84
|
attributes = attributes.merge(relationships)
|
|
85
85
|
|
|
86
|
-
attributes.inject({}) do |attributes, (key, value)|
|
|
86
|
+
attributes.to_h.inject({}) do |attributes, (key, value)|
|
|
87
87
|
attributes[key.to_s.underscore.to_sym] = value
|
|
88
88
|
attributes
|
|
89
89
|
end
|
|
@@ -97,7 +97,7 @@ module JSONAPI
|
|
|
97
97
|
relationships = @data['relationships'] || {}
|
|
98
98
|
relationships = relationships.slice(*self.class.whitelist_relationships)
|
|
99
99
|
|
|
100
|
-
relationships.inject({}) do |relationships, (relationship_key, relationship_object)|
|
|
100
|
+
relationships.to_h.inject({}) do |relationships, (relationship_key, relationship_object)|
|
|
101
101
|
data = relationship_object['data']
|
|
102
102
|
|
|
103
103
|
if data.is_a?(Array)
|