jsonapi_compliable 0.6.13 → 0.7.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/.yardopts +1 -0
- data/docs/Jsonapi/ResourceGenerator.html +325 -0
- data/docs/Jsonapi.html +115 -0
- data/docs/JsonapiCompliable/Adapters/Abstract.html +1 -1
- data/docs/JsonapiCompliable/Adapters/ActiveRecord.html +59 -53
- data/docs/JsonapiCompliable/Adapters/ActiveRecordSideloading.html +6 -6
- data/docs/JsonapiCompliable/Adapters/Null.html +1 -1
- data/docs/JsonapiCompliable/Adapters.html +1 -1
- data/docs/JsonapiCompliable/Base.html +113 -117
- data/docs/JsonapiCompliable/Deserializer.html +87 -22
- data/docs/JsonapiCompliable/Errors/BadFilter.html +1 -1
- data/docs/JsonapiCompliable/Errors/StatNotFound.html +1 -1
- data/docs/JsonapiCompliable/Errors/UnsupportedPageSize.html +1 -1
- data/docs/JsonapiCompliable/Errors/ValidationError.html +1 -1
- data/docs/JsonapiCompliable/Errors.html +1 -1
- data/docs/JsonapiCompliable/Extensions/BooleanAttribute/ClassMethods.html +1 -1
- data/docs/JsonapiCompliable/Extensions/BooleanAttribute.html +1 -1
- data/docs/JsonapiCompliable/Extensions/ExtraAttribute/ClassMethods.html +1 -1
- data/docs/JsonapiCompliable/Extensions/ExtraAttribute.html +1 -1
- data/docs/JsonapiCompliable/Extensions.html +1 -1
- data/docs/JsonapiCompliable/Query.html +19 -17
- data/docs/JsonapiCompliable/Rails.html +1 -1
- data/docs/JsonapiCompliable/Resource.html +311 -220
- data/docs/JsonapiCompliable/Scope.html +1 -1
- data/docs/JsonapiCompliable/Scoping/Base.html +1 -1
- data/docs/JsonapiCompliable/Scoping/DefaultFilter.html +1 -1
- data/docs/JsonapiCompliable/Scoping/ExtraFields.html +1 -1
- data/docs/JsonapiCompliable/Scoping/Filter.html +1 -1
- data/docs/JsonapiCompliable/Scoping/Filterable.html +2 -2
- data/docs/JsonapiCompliable/Scoping/Paginate.html +1 -1
- data/docs/JsonapiCompliable/Scoping/Sort.html +1 -1
- data/docs/JsonapiCompliable/Scoping.html +1 -1
- data/docs/JsonapiCompliable/SerializableTempId.html +1 -1
- data/docs/JsonapiCompliable/Sideload.html +229 -78
- data/docs/JsonapiCompliable/Stats/DSL.html +1 -1
- data/docs/JsonapiCompliable/Stats/Payload.html +1 -1
- data/docs/JsonapiCompliable/Stats.html +1 -1
- data/docs/JsonapiCompliable/Util/FieldParams.html +1 -1
- data/docs/JsonapiCompliable/Util/Hash.html +1 -1
- data/docs/JsonapiCompliable/Util/IncludeParams.html +1 -1
- data/docs/JsonapiCompliable/Util/Persistence.html +1 -1
- data/docs/JsonapiCompliable/Util/RelationshipPayload.html +1 -1
- data/docs/JsonapiCompliable/Util/RenderOptions.html +1 -1
- data/docs/JsonapiCompliable/Util/ValidationResponse.html +1 -1
- data/docs/JsonapiCompliable/Util.html +1 -1
- data/docs/JsonapiCompliable.html +210 -3
- data/docs/_index.html +13 -1
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +4 -2
- data/docs/index.html +4 -2
- data/docs/method_list.html +307 -243
- data/docs/top-level-namespace.html +2 -2
- data/lib/generators/jsonapi/resource_generator.rb +139 -58
- data/lib/generators/jsonapi/templates/application_resource.rb.erb +11 -2
- data/lib/generators/jsonapi/templates/controller.rb.erb +34 -0
- data/lib/generators/jsonapi/templates/destroy_request_spec.rb.erb +1 -1
- data/lib/generators/jsonapi/templates/payload.rb.erb +31 -0
- data/lib/generators/jsonapi/templates/resource.rb.erb +47 -0
- data/lib/generators/jsonapi/templates/serializer.rb.erb +17 -0
- data/lib/jsonapi_compliable/adapters/active_record_sideloading.rb +5 -5
- data/lib/jsonapi_compliable/resource.rb +11 -5
- data/lib/jsonapi_compliable/sideload.rb +40 -11
- data/lib/jsonapi_compliable/util/persistence.rb +9 -2
- data/lib/jsonapi_compliable/util/relationship_payload.rb +6 -0
- data/lib/jsonapi_compliable/util/validation_response.rb +2 -1
- data/lib/jsonapi_compliable/version.rb +1 -1
- metadata +4 -2
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
116
|
<div id="footer">
|
|
117
|
-
Generated on
|
|
117
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
118
118
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
119
119
|
0.9.9 (ruby-2.3.0).
|
|
120
120
|
</div>
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
</div>
|
|
106
106
|
|
|
107
107
|
<div id="footer">
|
|
108
|
-
Generated on
|
|
108
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
110
110
|
0.9.9 (ruby-2.3.0).
|
|
111
111
|
</div>
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
</div>
|
|
220
220
|
|
|
221
221
|
<div id="footer">
|
|
222
|
-
Generated on
|
|
222
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
223
223
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
224
224
|
0.9.9 (ruby-2.3.0).
|
|
225
225
|
</div>
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
</div>
|
|
203
203
|
|
|
204
204
|
<div id="footer">
|
|
205
|
-
Generated on
|
|
205
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
206
206
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
207
207
|
0.9.9 (ruby-2.3.0).
|
|
208
208
|
</div>
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
</div>
|
|
228
228
|
|
|
229
229
|
<div id="footer">
|
|
230
|
-
Generated on
|
|
230
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
231
231
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
232
232
|
0.9.9 (ruby-2.3.0).
|
|
233
233
|
</div>
|
|
@@ -232,7 +232,7 @@ extra attribute. See (Resource.extra_field).</p>
|
|
|
232
232
|
</div>
|
|
233
233
|
|
|
234
234
|
<div id="footer">
|
|
235
|
-
Generated on
|
|
235
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
236
236
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
237
237
|
0.9.9 (ruby-2.3.0).
|
|
238
238
|
</div>
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
<div id="footer">
|
|
110
|
-
Generated on
|
|
110
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
112
112
|
0.9.9 (ruby-2.3.0).
|
|
113
113
|
</div>
|
|
@@ -392,7 +392,8 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
392
392
|
24
|
|
393
393
|
25
|
|
394
394
|
26
|
|
395
|
-
27
|
|
395
|
+
27
|
|
396
|
+
28</pre>
|
|
396
397
|
</td>
|
|
397
398
|
<td>
|
|
398
399
|
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line 24</span>
|
|
@@ -400,6 +401,7 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
400
401
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
|
401
402
|
<span class='ivar'>@resource</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span>
|
|
402
403
|
<span class='ivar'>@params</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span>
|
|
404
|
+
<span class='ivar'>@params</span> <span class='op'>=</span> <span class='ivar'>@params</span><span class='period'>.</span><span class='id identifier rubyid_permit!'>permit!</span> <span class='kw'>if</span> <span class='ivar'>@params</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:permit!</span><span class='rparen'>)</span>
|
|
403
405
|
<span class='kw'>end</span></pre>
|
|
404
406
|
</td>
|
|
405
407
|
</tr>
|
|
@@ -649,12 +651,12 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
649
651
|
<pre class="lines">
|
|
650
652
|
|
|
651
653
|
|
|
652
|
-
71
|
|
653
654
|
72
|
|
654
|
-
73
|
|
655
|
+
73
|
|
656
|
+
74</pre>
|
|
655
657
|
</td>
|
|
656
658
|
<td>
|
|
657
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line
|
|
659
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line 72</span>
|
|
658
660
|
|
|
659
661
|
<span class='kw'>def</span> <span class='id identifier rubyid_association_names'>association_names</span>
|
|
660
662
|
<span class='ivar'>@association_names</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Util.html" title="JsonapiCompliable::Util (module)">Util</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util/Hash.html" title="JsonapiCompliable::Util::Hash (class)">Hash</a></span></span><span class='period'>.</span><span class='id identifier rubyid_keys'><span class='object_link'><a href="Util/Hash.html#keys-class_method" title="JsonapiCompliable::Util::Hash.keys (method)">keys</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_include_hash'>include_hash</span><span class='rparen'>)</span>
|
|
@@ -710,12 +712,12 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
710
712
|
<pre class="lines">
|
|
711
713
|
|
|
712
714
|
|
|
713
|
-
32
|
|
714
715
|
33
|
|
715
|
-
34
|
|
716
|
+
34
|
|
717
|
+
35</pre>
|
|
716
718
|
</td>
|
|
717
719
|
<td>
|
|
718
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line
|
|
720
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line 33</span>
|
|
719
721
|
|
|
720
722
|
<span class='kw'>def</span> <span class='id identifier rubyid_include_directive'>include_directive</span>
|
|
721
723
|
<span class='ivar'>@include_directive</span> <span class='op'>||=</span> <span class='const'>JSONAPI</span><span class='op'>::</span><span class='const'>IncludeDirective</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:include</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
@@ -787,7 +789,6 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
787
789
|
<pre class="lines">
|
|
788
790
|
|
|
789
791
|
|
|
790
|
-
49
|
|
791
792
|
50
|
|
792
793
|
51
|
|
793
794
|
52
|
|
@@ -796,10 +797,11 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
796
797
|
55
|
|
797
798
|
56
|
|
798
799
|
57
|
|
799
|
-
58
|
|
800
|
+
58
|
|
801
|
+
59</pre>
|
|
800
802
|
</td>
|
|
801
803
|
<td>
|
|
802
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line
|
|
804
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line 50</span>
|
|
803
805
|
|
|
804
806
|
<span class='kw'>def</span> <span class='id identifier rubyid_include_hash'>include_hash</span>
|
|
805
807
|
<span class='ivar'>@include_hash</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
|
@@ -946,7 +948,6 @@ top-level:</p>
|
|
|
946
948
|
<pre class="lines">
|
|
947
949
|
|
|
948
950
|
|
|
949
|
-
120
|
|
950
951
|
121
|
|
951
952
|
122
|
|
952
953
|
123
|
|
@@ -968,10 +969,11 @@ top-level:</p>
|
|
|
968
969
|
139
|
|
969
970
|
140
|
|
970
971
|
141
|
|
971
|
-
142
|
|
972
|
+
142
|
|
973
|
+
143</pre>
|
|
972
974
|
</td>
|
|
973
975
|
<td>
|
|
974
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line
|
|
976
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line 121</span>
|
|
975
977
|
|
|
976
978
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_hash'>to_hash</span>
|
|
977
979
|
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=></span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_default_hash'>default_hash</span> <span class='rbrace'>}</span>
|
|
@@ -1065,14 +1067,14 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
1065
1067
|
<pre class="lines">
|
|
1066
1068
|
|
|
1067
1069
|
|
|
1068
|
-
159
|
|
1069
1070
|
160
|
|
1070
1071
|
161
|
|
1071
1072
|
162
|
|
1072
|
-
163
|
|
1073
|
+
163
|
|
1074
|
+
164</pre>
|
|
1073
1075
|
</td>
|
|
1074
1076
|
<td>
|
|
1075
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line
|
|
1077
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/query.rb', line 160</span>
|
|
1076
1078
|
|
|
1077
1079
|
<span class='kw'>def</span> <span class='id identifier rubyid_zero_results?'>zero_results?</span>
|
|
1078
1080
|
<span class='op'>!</span><span class='ivar'>@params</span><span class='lbracket'>[</span><span class='symbol'>:page</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&&</span>
|
|
@@ -1089,7 +1091,7 @@ get, say, the total count without the overhead of fetching actual records.</p>
|
|
|
1089
1091
|
</div>
|
|
1090
1092
|
|
|
1091
1093
|
<div id="footer">
|
|
1092
|
-
Generated on
|
|
1094
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
1093
1095
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1094
1096
|
0.9.9 (ruby-2.3.0).
|
|
1095
1097
|
</div>
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
</div>
|
|
202
202
|
|
|
203
203
|
<div id="footer">
|
|
204
|
-
Generated on
|
|
204
|
+
Generated on Wed Jun 7 10:15:09 2017 by
|
|
205
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
206
206
|
0.9.9 (ruby-2.3.0).
|
|
207
207
|
</div>
|