restful-jsonapi 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restful/jsonapi/restify_param.rb +16 -12
- data/lib/restful/jsonapi/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: c95b843d237e9fb6a1d54a06d9fa56b593ca139e
|
4
|
+
data.tar.gz: 2011d6e50f9ba1288388459e12d3771cf06d2504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c58c0708376897a6e22ff0cf37e7105c3ab3089e802ba3e951712417737f4f6c1cbc1099e7eae7aec2ac05960089a2f773db288d6c0c5e6bedc376710e8a31
|
7
|
+
data.tar.gz: 5e02c6952a73781270cf5e3d99e74d0c0a33b413fe0711f9f1976a7afda3e4ed90da633dc1593ec93e0eea1d65ec02c064d1d51e90b9fec8fcf0158a8ac1f435
|
@@ -50,18 +50,22 @@ module Restful
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def restify_has_many(relationship_name, relationship_data)
|
53
|
-
if relationship_data[:data].
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
53
|
+
if relationship_data[:data].present?
|
54
|
+
if relationship_data[:data].select{|d|d[:attributes]||d[:relationships]}.blank?
|
55
|
+
relationship_key = relationship_name.to_s.singularize.underscore+"_ids"
|
56
|
+
relationship = []
|
57
|
+
relationship_data[:data].each do |vv|
|
58
|
+
relationship.push vv[:id]
|
59
|
+
end
|
60
|
+
{relationship_key => relationship}
|
61
|
+
else
|
62
|
+
relationship_key = relationship_name.to_s.underscore+"_attributes"
|
63
|
+
relationship = []
|
64
|
+
relationship_data[:data].each do |vv|
|
65
|
+
relationship.push restify_data(relationship_name,vv)
|
66
|
+
end
|
67
|
+
{relationship_key => relationship}
|
68
|
+
end
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful-jsonapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Wentz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|