jsonapi_compliable 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/Jsonapi/ResourceGenerator.html +1 -1
- data/docs/Jsonapi.html +1 -1
- data/docs/JsonapiCompliable/Adapters/Abstract.html +1 -1
- data/docs/JsonapiCompliable/Adapters/ActiveRecord.html +1 -1
- data/docs/JsonapiCompliable/Adapters/ActiveRecordSideloading.html +1 -1
- data/docs/JsonapiCompliable/Adapters/Null.html +1 -1
- data/docs/JsonapiCompliable/Adapters.html +1 -1
- data/docs/JsonapiCompliable/Base.html +389 -62
- data/docs/JsonapiCompliable/Deserializer.html +1 -1
- 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 +27 -21
- data/docs/JsonapiCompliable/Rails.html +1 -1
- data/docs/JsonapiCompliable/Resource.html +189 -572
- 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 +1 -1
- 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 +164 -384
- 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 +2 -2
- data/docs/_index.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/method_list.html +191 -215
- data/docs/top-level-namespace.html +1 -1
- data/lib/jsonapi_compliable/base.rb +43 -1
- data/lib/jsonapi_compliable/query.rb +8 -5
- data/lib/jsonapi_compliable/resource.rb +2 -90
- data/lib/jsonapi_compliable/scope.rb +2 -4
- data/lib/jsonapi_compliable/sideload.rb +7 -59
- data/lib/jsonapi_compliable/version.rb +1 -1
- metadata +2 -2
@@ -681,30 +681,6 @@ relationships between resources:</p>
|
|
681
681
|
|
682
682
|
<span class="summary_desc"><div class='inline'></div></span>
|
683
683
|
|
684
|
-
</li>
|
685
|
-
|
686
|
-
|
687
|
-
<li class="public ">
|
688
|
-
<span class="summary_signature">
|
689
|
-
|
690
|
-
<a href="#sideload_whitelist-class_method" title="sideload_whitelist (class method)">.<strong>sideload_whitelist</strong>(whitelist) ⇒ Object </a>
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
</span>
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
<span class="summary_desc"><div class='inline'>
|
705
|
-
<p>Set the sideload whitelist.</p>
|
706
|
-
</div></span>
|
707
|
-
|
708
684
|
</li>
|
709
685
|
|
710
686
|
|
@@ -830,31 +806,6 @@ relationships between resources:</p>
|
|
830
806
|
|
831
807
|
<span class="summary_desc"><div class='inline'></div></span>
|
832
808
|
|
833
|
-
</li>
|
834
|
-
|
835
|
-
|
836
|
-
<li class="public ">
|
837
|
-
<span class="summary_signature">
|
838
|
-
|
839
|
-
<a href="#allowed_sideloads-instance_method" title="#allowed_sideloads (instance method)">#<strong>allowed_sideloads</strong>(namespace = nil) ⇒ Hash </a>
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
</span>
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
<span class="summary_desc"><div class='inline'>
|
854
|
-
<p>An Include Directive Hash of all possible sideloads for the current context
|
855
|
-
namespace, taking into account the sideload whitelist.</p>
|
856
|
-
</div></span>
|
857
|
-
|
858
809
|
</li>
|
859
810
|
|
860
811
|
|
@@ -885,7 +836,7 @@ namespace, taking into account the sideload whitelist.</p>
|
|
885
836
|
<li class="public ">
|
886
837
|
<span class="summary_signature">
|
887
838
|
|
888
|
-
<a href="#association_names-instance_method" title="#association_names (instance method)">#<strong>association_names</strong> ⇒
|
839
|
+
<a href="#association_names-instance_method" title="#association_names (instance method)">#<strong>association_names</strong> ⇒ Object </a>
|
889
840
|
|
890
841
|
|
891
842
|
|
@@ -899,9 +850,7 @@ namespace, taking into account the sideload whitelist.</p>
|
|
899
850
|
|
900
851
|
|
901
852
|
|
902
|
-
<span class="summary_desc"><div class='inline'>
|
903
|
-
<p>All possible sideload names, including nested names.</p>
|
904
|
-
</div></span>
|
853
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
905
854
|
|
906
855
|
</li>
|
907
856
|
|
@@ -1266,28 +1215,6 @@ namespace, taking into account the sideload whitelist.</p>
|
|
1266
1215
|
|
1267
1216
|
|
1268
1217
|
|
1269
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
1270
|
-
|
1271
|
-
</li>
|
1272
|
-
|
1273
|
-
|
1274
|
-
<li class="public ">
|
1275
|
-
<span class="summary_signature">
|
1276
|
-
|
1277
|
-
<a href="#sideload_whitelist-instance_method" title="#sideload_whitelist (instance method)">#<strong>sideload_whitelist</strong> ⇒ Object </a>
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
</span>
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
<span class="private note title">private</span>
|
1289
|
-
|
1290
|
-
|
1291
1218
|
<span class="summary_desc"><div class='inline'></div></span>
|
1292
1219
|
|
1293
1220
|
</li>
|
@@ -1536,12 +1463,12 @@ introspection. Gets dup'd when inherited.</p>
|
|
1536
1463
|
<pre class="lines">
|
1537
1464
|
|
1538
1465
|
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1466
|
+
383
|
1467
|
+
384
|
1468
|
+
385</pre>
|
1542
1469
|
</td>
|
1543
1470
|
<td>
|
1544
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
1471
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 383</span>
|
1545
1472
|
|
1546
1473
|
<span class='kw'>def</span> <span class='id identifier rubyid_config'>config</span>
|
1547
1474
|
<span class='ivar'>@config</span>
|
@@ -1614,12 +1541,12 @@ href=":object">JsonapiCompliable.context</a>+</p>
|
|
1614
1541
|
<pre class="lines">
|
1615
1542
|
|
1616
1543
|
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1544
|
+
428
|
1545
|
+
429
|
1546
|
+
430</pre>
|
1620
1547
|
</td>
|
1621
1548
|
<td>
|
1622
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
1549
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 428</span>
|
1623
1550
|
|
1624
1551
|
<span class='kw'>def</span> <span class='id identifier rubyid_context'>context</span>
|
1625
1552
|
<span class='ivar'>@context</span>
|
@@ -1823,18 +1750,18 @@ filter. Mainly used for backwards-compatibility.</p>
|
|
1823
1750
|
<pre class="lines">
|
1824
1751
|
|
1825
1752
|
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1753
|
+
169
|
1754
|
+
170
|
1755
|
+
171
|
1756
|
+
172
|
1757
|
+
173
|
1758
|
+
174
|
1759
|
+
175
|
1760
|
+
176
|
1761
|
+
177</pre>
|
1835
1762
|
</td>
|
1836
1763
|
<td>
|
1837
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
1764
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 169</span>
|
1838
1765
|
|
1839
1766
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_allow_filter'>allow_filter</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
1840
1767
|
<span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_extract_options!'>extract_options!</span>
|
@@ -2015,14 +1942,14 @@ end</code></pre>
|
|
2015
1942
|
<pre class="lines">
|
2016
1943
|
|
2017
1944
|
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
1945
|
+
208
|
1946
|
+
209
|
1947
|
+
210
|
1948
|
+
211
|
1949
|
+
212</pre>
|
2023
1950
|
</td>
|
2024
1951
|
<td>
|
2025
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
1952
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 208</span>
|
2026
1953
|
|
2027
1954
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_allow_stat'>allow_stat</span><span class='lparen'>(</span><span class='id identifier rubyid_symbol_or_hash'>symbol_or_hash</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
2028
1955
|
<span class='id identifier rubyid_dsl'>dsl</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Stats.html" title="JsonapiCompliable::Stats (module)">Stats</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Stats/DSL.html" title="JsonapiCompliable::Stats::DSL (class)">DSL</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Stats/DSL.html#initialize-instance_method" title="JsonapiCompliable::Stats::DSL#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_symbol_or_hash'>symbol_or_hash</span><span class='rparen'>)</span>
|
@@ -2180,14 +2107,14 @@ corresponding <code>allow_filter</code>:</p>
|
|
2180
2107
|
<pre class="lines">
|
2181
2108
|
|
2182
2109
|
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
2110
|
+
236
|
2111
|
+
237
|
2112
|
+
238
|
2113
|
+
239
|
2114
|
+
240</pre>
|
2188
2115
|
</td>
|
2189
2116
|
<td>
|
2190
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2117
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 236</span>
|
2191
2118
|
|
2192
2119
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_filter'>default_filter</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
2193
2120
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_filters</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
@@ -2245,12 +2172,12 @@ corresponding <code>allow_filter</code>:</p>
|
|
2245
2172
|
<pre class="lines">
|
2246
2173
|
|
2247
2174
|
|
2248
|
-
|
2249
|
-
|
2250
|
-
|
2175
|
+
363
|
2176
|
+
364
|
2177
|
+
365</pre>
|
2251
2178
|
</td>
|
2252
2179
|
<td>
|
2253
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2180
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 363</span>
|
2254
2181
|
|
2255
2182
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_page_number'>default_page_number</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
|
2256
2183
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_page_number</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_val'>val</span>
|
@@ -2315,12 +2242,12 @@ corresponding <code>allow_filter</code>:</p>
|
|
2315
2242
|
<pre class="lines">
|
2316
2243
|
|
2317
2244
|
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2245
|
+
374
|
2246
|
+
375
|
2247
|
+
376</pre>
|
2321
2248
|
</td>
|
2322
2249
|
<td>
|
2323
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2250
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 374</span>
|
2324
2251
|
|
2325
2252
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_page_size'>default_page_size</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
|
2326
2253
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_page_size</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_val'>val</span>
|
@@ -2391,12 +2318,12 @@ corresponding <code>allow_filter</code>:</p>
|
|
2391
2318
|
<pre class="lines">
|
2392
2319
|
|
2393
2320
|
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2321
|
+
335
|
2322
|
+
336
|
2323
|
+
337</pre>
|
2397
2324
|
</td>
|
2398
2325
|
<td>
|
2399
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2326
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 335</span>
|
2400
2327
|
|
2401
2328
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_sort'>default_sort</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
|
2402
2329
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_sort</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_val'>val</span>
|
@@ -2529,12 +2456,12 @@ load data that will be used to compute the extra field.</p>
|
|
2529
2456
|
<pre class="lines">
|
2530
2457
|
|
2531
2458
|
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2459
|
+
311
|
2460
|
+
312
|
2461
|
+
313</pre>
|
2535
2462
|
</td>
|
2536
2463
|
<td>
|
2537
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2464
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 311</span>
|
2538
2465
|
|
2539
2466
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_extra_field'>extra_field</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
2540
2467
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:extra_fields</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_blk'>blk</span>
|
@@ -2761,12 +2688,12 @@ load data that will be used to compute the extra field.</p>
|
|
2761
2688
|
<pre class="lines">
|
2762
2689
|
|
2763
2690
|
|
2764
|
-
|
2765
|
-
|
2766
|
-
|
2691
|
+
255
|
2692
|
+
256
|
2693
|
+
257</pre>
|
2767
2694
|
</td>
|
2768
2695
|
<td>
|
2769
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2696
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 255</span>
|
2770
2697
|
|
2771
2698
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_model'>model</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
|
2772
2699
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:model</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span>
|
@@ -2869,12 +2796,12 @@ load data that will be used to compute the extra field.</p>
|
|
2869
2796
|
<pre class="lines">
|
2870
2797
|
|
2871
2798
|
|
2872
|
-
|
2873
|
-
|
2874
|
-
|
2799
|
+
289
|
2800
|
+
290
|
2801
|
+
291</pre>
|
2875
2802
|
</td>
|
2876
2803
|
<td>
|
2877
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
2804
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 289</span>
|
2878
2805
|
|
2879
2806
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_paginate'>paginate</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
2880
2807
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:pagination</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_blk'>blk</span>
|
@@ -2966,100 +2893,6 @@ load data that will be used to compute the extra field.</p>
|
|
2966
2893
|
</td>
|
2967
2894
|
</tr>
|
2968
2895
|
</table>
|
2969
|
-
</div>
|
2970
|
-
|
2971
|
-
<div class="method_details ">
|
2972
|
-
<h3 class="signature " id="sideload_whitelist-class_method">
|
2973
|
-
|
2974
|
-
.<strong>sideload_whitelist</strong>(whitelist) ⇒ <tt>Object</tt>
|
2975
|
-
|
2976
|
-
|
2977
|
-
|
2978
|
-
|
2979
|
-
|
2980
|
-
</h3><div class="docstring">
|
2981
|
-
<div class="discussion">
|
2982
|
-
|
2983
|
-
<p>Set the sideload whitelist. You may want to omit sideloads for security or
|
2984
|
-
performance reasons.</p>
|
2985
|
-
|
2986
|
-
<p>Uses JSONAPI::IncludeDirective from <a href="{http://jsonapi-rb.org" target="_parent" title="jsonapi-rb">jsonapi-rb</a>}</p>
|
2987
|
-
|
2988
|
-
|
2989
|
-
</div>
|
2990
|
-
</div>
|
2991
|
-
<div class="tags">
|
2992
|
-
|
2993
|
-
<div class="examples">
|
2994
|
-
<p class="tag_title">Examples:</p>
|
2995
|
-
|
2996
|
-
|
2997
|
-
<p class="example_title"><div class='inline'>
|
2998
|
-
<p>Whitelisting Relationships</p>
|
2999
|
-
</div></p>
|
3000
|
-
|
3001
|
-
<pre class="example code"><code><span class='comment'># Given the following whitelist
|
3002
|
-
</span><span class='kw'>class</span> <span class='const'>PostResource</span> <span class='op'><</span> <span class='const'>ApplicationResource</span>
|
3003
|
-
<span class='comment'># ... code ...
|
3004
|
-
</span> <span class='id identifier rubyid_sideload_whitelist'>sideload_whitelist</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='symbol'>:blog</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>comments:</span> <span class='symbol'>:author</span> <span class='rbrace'>}</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
3005
|
-
<span class='kw'>end</span>
|
3006
|
-
|
3007
|
-
<span class='comment'># A request to sideload 'tags'
|
3008
|
-
</span><span class='comment'>#
|
3009
|
-
</span><span class='comment'># GET /posts?include=tags
|
3010
|
-
</span><span class='comment'>#
|
3011
|
-
</span><span class='comment'># ...will silently fail.
|
3012
|
-
</span><span class='comment'>#
|
3013
|
-
</span><span class='comment'># A request for comments and tags:
|
3014
|
-
</span><span class='comment'>#
|
3015
|
-
</span><span class='comment'># GET /posts?include=tags,comments
|
3016
|
-
</span><span class='comment'>#
|
3017
|
-
</span><span class='comment'># ...will only sideload comments</span></code></pre>
|
3018
|
-
|
3019
|
-
</div>
|
3020
|
-
<p class="tag_title">Parameters:</p>
|
3021
|
-
<ul class="param">
|
3022
|
-
|
3023
|
-
<li>
|
3024
|
-
|
3025
|
-
<span class='name'>whitelist</span>
|
3026
|
-
|
3027
|
-
|
3028
|
-
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>Symbol</tt>)</span>
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
</li>
|
3033
|
-
|
3034
|
-
</ul>
|
3035
|
-
|
3036
|
-
|
3037
|
-
<p class="tag_title">See Also:</p>
|
3038
|
-
<ul class="see">
|
3039
|
-
|
3040
|
-
<li><span class='object_link'><a href="Query.html#include_hash-instance_method" title="JsonapiCompliable::Query#include_hash (method)">Query#include_hash</a></span></li>
|
3041
|
-
|
3042
|
-
</ul>
|
3043
|
-
|
3044
|
-
</div><table class="source_code">
|
3045
|
-
<tr>
|
3046
|
-
<td>
|
3047
|
-
<pre class="lines">
|
3048
|
-
|
3049
|
-
|
3050
|
-
161
|
3051
|
-
162
|
3052
|
-
163</pre>
|
3053
|
-
</td>
|
3054
|
-
<td>
|
3055
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 161</span>
|
3056
|
-
|
3057
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sideload_whitelist'>sideload_whitelist</span><span class='lparen'>(</span><span class='id identifier rubyid_whitelist'>whitelist</span><span class='rparen'>)</span>
|
3058
|
-
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:sideload_whitelist</span><span class='rbracket'>]</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_whitelist'>whitelist</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span>
|
3059
|
-
<span class='kw'>end</span></pre>
|
3060
|
-
</td>
|
3061
|
-
</tr>
|
3062
|
-
</table>
|
3063
2896
|
</div>
|
3064
2897
|
|
3065
2898
|
<div class="method_details ">
|
@@ -3202,12 +3035,12 @@ performance reasons.</p>
|
|
3202
3035
|
<pre class="lines">
|
3203
3036
|
|
3204
3037
|
|
3205
|
-
|
3206
|
-
|
3207
|
-
|
3038
|
+
274
|
3039
|
+
275
|
3040
|
+
276</pre>
|
3208
3041
|
</td>
|
3209
3042
|
<td>
|
3210
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3043
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 274</span>
|
3211
3044
|
|
3212
3045
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
3213
3046
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:sorting</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_blk'>blk</span>
|
@@ -3285,12 +3118,12 @@ performance reasons.</p>
|
|
3285
3118
|
<pre class="lines">
|
3286
3119
|
|
3287
3120
|
|
3288
|
-
|
3289
|
-
|
3290
|
-
|
3121
|
+
357
|
3122
|
+
358
|
3123
|
+
359</pre>
|
3291
3124
|
</td>
|
3292
3125
|
<td>
|
3293
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3126
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 357</span>
|
3294
3127
|
|
3295
3128
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
3296
3129
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
@@ -3359,12 +3192,12 @@ performance reasons.</p>
|
|
3359
3192
|
<pre class="lines">
|
3360
3193
|
|
3361
3194
|
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3195
|
+
322
|
3196
|
+
323
|
3197
|
+
324</pre>
|
3365
3198
|
</td>
|
3366
3199
|
<td>
|
3367
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3200
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 322</span>
|
3368
3201
|
|
3369
3202
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_use_adapter'>use_adapter</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
|
3370
3203
|
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
@@ -3415,12 +3248,12 @@ performance reasons.</p>
|
|
3415
3248
|
<pre class="lines">
|
3416
3249
|
|
3417
3250
|
|
3418
|
-
|
3419
|
-
|
3420
|
-
|
3251
|
+
645
|
3252
|
+
646
|
3253
|
+
647</pre>
|
3421
3254
|
</td>
|
3422
3255
|
<td>
|
3423
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3256
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 645</span>
|
3424
3257
|
|
3425
3258
|
<span class='kw'>def</span> <span class='id identifier rubyid_adapter'>adapter</span>
|
3426
3259
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span>
|
@@ -3428,132 +3261,6 @@ performance reasons.</p>
|
|
3428
3261
|
</td>
|
3429
3262
|
</tr>
|
3430
3263
|
</table>
|
3431
|
-
</div>
|
3432
|
-
|
3433
|
-
<div class="method_details ">
|
3434
|
-
<h3 class="signature " id="allowed_sideloads-instance_method">
|
3435
|
-
|
3436
|
-
#<strong>allowed_sideloads</strong>(namespace = nil) ⇒ <tt>Hash</tt>
|
3437
|
-
|
3438
|
-
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
</h3><div class="docstring">
|
3443
|
-
<div class="discussion">
|
3444
|
-
|
3445
|
-
<p>An Include Directive Hash of all possible sideloads for the current context
|
3446
|
-
namespace, taking into account the sideload whitelist.</p>
|
3447
|
-
|
3448
|
-
<p>In other words, say we have this resource:</p>
|
3449
|
-
|
3450
|
-
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>PostResource</span> <span class='op'><</span> <span class='const'>ApplicationResource</span>
|
3451
|
-
<span class='id identifier rubyid_sideload_whitelist'>sideload_whitelist</span><span class='lparen'>(</span><span class='lbrace'>{</span>
|
3452
|
-
<span class='label'>index:</span> <span class='symbol'>:comments</span><span class='comma'>,</span>
|
3453
|
-
<span class='label'>show:</span> <span class='lbrace'>{</span> <span class='label'>comments:</span> <span class='symbol'>:author</span> <span class='rbrace'>}</span>
|
3454
|
-
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
3455
|
-
<span class='kw'>end</span>
|
3456
|
-
</code></pre>
|
3457
|
-
|
3458
|
-
<p>Expected behavior:</p>
|
3459
|
-
|
3460
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_allowed_sideloads'>allowed_sideloads</span><span class='lparen'>(</span><span class='symbol'>:index</span><span class='rparen'>)</span> <span class='comment'># => { comments: {} }
|
3461
|
-
</span><span class='id identifier rubyid_allowed_sideloads'>allowed_sideloads</span><span class='lparen'>(</span><span class='symbol'>:show</span><span class='rparen'>)</span> <span class='comment'># => { comments: { author: {} }
|
3462
|
-
</span>
|
3463
|
-
<span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_with_context'>with_context</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='symbol'>:index</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
3464
|
-
<span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_allowed_sideloads'>allowed_sideloads</span> <span class='comment'># => { comments: {} }
|
3465
|
-
</span><span class='kw'>end</span>
|
3466
|
-
</code></pre>
|
3467
|
-
|
3468
|
-
|
3469
|
-
</div>
|
3470
|
-
</div>
|
3471
|
-
<div class="tags">
|
3472
|
-
<p class="tag_title">Parameters:</p>
|
3473
|
-
<ul class="param">
|
3474
|
-
|
3475
|
-
<li>
|
3476
|
-
|
3477
|
-
<span class='name'>namespace</span>
|
3478
|
-
|
3479
|
-
|
3480
|
-
<span class='type'>(<tt>Symbol</tt>)</span>
|
3481
|
-
|
3482
|
-
|
3483
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
3484
|
-
|
3485
|
-
|
3486
|
-
—
|
3487
|
-
<div class='inline'>
|
3488
|
-
<p>Can be :index/:show/etc - The current context namespace will be used by
|
3489
|
-
default.</p>
|
3490
|
-
</div>
|
3491
|
-
|
3492
|
-
</li>
|
3493
|
-
|
3494
|
-
</ul>
|
3495
|
-
|
3496
|
-
<p class="tag_title">Returns:</p>
|
3497
|
-
<ul class="return">
|
3498
|
-
|
3499
|
-
<li>
|
3500
|
-
|
3501
|
-
|
3502
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
3503
|
-
|
3504
|
-
|
3505
|
-
|
3506
|
-
—
|
3507
|
-
<div class='inline'>
|
3508
|
-
<p>the scrubbed include directive</p>
|
3509
|
-
</div>
|
3510
|
-
|
3511
|
-
</li>
|
3512
|
-
|
3513
|
-
</ul>
|
3514
|
-
|
3515
|
-
<p class="tag_title">See Also:</p>
|
3516
|
-
<ul class="see">
|
3517
|
-
|
3518
|
-
<li><span class='object_link'><a href="Util/IncludeParams.html#scrub-class_method" title="JsonapiCompliable::Util::IncludeParams.scrub (method)">Util::IncludeParams.scrub</a></span></li>
|
3519
|
-
|
3520
|
-
<li><span class='object_link'><a href="#with_context-instance_method" title="JsonapiCompliable::Resource#with_context (method)">#with_context</a></span></li>
|
3521
|
-
|
3522
|
-
</ul>
|
3523
|
-
|
3524
|
-
</div><table class="source_code">
|
3525
|
-
<tr>
|
3526
|
-
<td>
|
3527
|
-
<pre class="lines">
|
3528
|
-
|
3529
|
-
|
3530
|
-
616
|
3531
|
-
617
|
3532
|
-
618
|
3533
|
-
619
|
3534
|
-
620
|
3535
|
-
621
|
3536
|
-
622
|
3537
|
-
623
|
3538
|
-
624
|
3539
|
-
625</pre>
|
3540
|
-
</td>
|
3541
|
-
<td>
|
3542
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 616</span>
|
3543
|
-
|
3544
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_allowed_sideloads'>allowed_sideloads</span><span class='lparen'>(</span><span class='id identifier rubyid_namespace'>namespace</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
3545
|
-
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='id identifier rubyid_sideloading'>sideloading</span>
|
3546
|
-
|
3547
|
-
<span class='id identifier rubyid_namespace'>namespace</span> <span class='op'>||=</span> <span class='id identifier rubyid_context_namespace'>context_namespace</span>
|
3548
|
-
<span class='id identifier rubyid_sideloads'>sideloads</span> <span class='op'>=</span> <span class='id identifier rubyid_sideloading'>sideloading</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span><span class='lbracket'>[</span><span class='symbol'>:base</span><span class='rbracket'>]</span>
|
3549
|
-
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_sideload_whitelist'>sideload_whitelist</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>&&</span> <span class='id identifier rubyid_namespace'>namespace</span>
|
3550
|
-
<span class='id identifier rubyid_sideloads'>sideloads</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/IncludeParams.html" title="JsonapiCompliable::Util::IncludeParams (class)">IncludeParams</a></span></span><span class='period'>.</span><span class='id identifier rubyid_scrub'><span class='object_link'><a href="Util/IncludeParams.html#scrub-class_method" title="JsonapiCompliable::Util::IncludeParams.scrub (method)">scrub</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_sideloads'>sideloads</span><span class='comma'>,</span> <span class='id identifier rubyid_sideload_whitelist'>sideload_whitelist</span><span class='lbracket'>[</span><span class='id identifier rubyid_namespace'>namespace</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
3551
|
-
<span class='kw'>end</span>
|
3552
|
-
<span class='id identifier rubyid_sideloads'>sideloads</span>
|
3553
|
-
<span class='kw'>end</span></pre>
|
3554
|
-
</td>
|
3555
|
-
</tr>
|
3556
|
-
</table>
|
3557
3264
|
</div>
|
3558
3265
|
|
3559
3266
|
<div class="method_details ">
|
@@ -3593,12 +3300,12 @@ default.</p>
|
|
3593
3300
|
<pre class="lines">
|
3594
3301
|
|
3595
3302
|
|
3596
|
-
|
3597
|
-
|
3598
|
-
|
3303
|
+
520
|
3304
|
+
521
|
3305
|
+
522</pre>
|
3599
3306
|
</td>
|
3600
3307
|
<td>
|
3601
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3308
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 520</span>
|
3602
3309
|
|
3603
3310
|
<span class='kw'>def</span> <span class='id identifier rubyid_associate'>associate</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_child'>child</span><span class='comma'>,</span> <span class='id identifier rubyid_association_name'>association_name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
3604
3311
|
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_associate'>associate</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_child'>child</span><span class='comma'>,</span> <span class='id identifier rubyid_association_name'>association_name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
@@ -3611,7 +3318,7 @@ default.</p>
|
|
3611
3318
|
<div class="method_details ">
|
3612
3319
|
<h3 class="signature " id="association_names-instance_method">
|
3613
3320
|
|
3614
|
-
#<strong>association_names</strong> ⇒ <tt>
|
3321
|
+
#<strong>association_names</strong> ⇒ <tt>Object</tt>
|
3615
3322
|
|
3616
3323
|
|
3617
3324
|
|
@@ -3620,44 +3327,16 @@ default.</p>
|
|
3620
3327
|
</h3><div class="docstring">
|
3621
3328
|
<div class="discussion">
|
3622
3329
|
|
3623
|
-
<p>All possible sideload names, including nested names</p>
|
3624
|
-
|
3625
|
-
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span> <span class='label'>comments:</span> <span class='lbrace'>{</span> <span class='label'>author:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
|
3626
|
-
</code></pre>
|
3627
|
-
|
3628
|
-
<p>Becomes</p>
|
3629
|
-
|
3630
|
-
<pre class="code ruby"><code class="ruby"><span class='lbracket'>[</span><span class='symbol'>:comments</span><span class='comma'>,</span> <span class='symbol'>:author</span><span class='rbracket'>]</span>
|
3631
|
-
</code></pre>
|
3632
|
-
|
3633
3330
|
|
3634
3331
|
</div>
|
3635
3332
|
</div>
|
3636
3333
|
<div class="tags">
|
3637
3334
|
|
3638
|
-
<p class="tag_title">Returns:</p>
|
3639
|
-
<ul class="return">
|
3640
|
-
|
3641
|
-
<li>
|
3642
|
-
|
3643
|
-
|
3644
|
-
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
3645
|
-
|
3646
|
-
|
3647
|
-
|
3648
|
-
—
|
3649
|
-
<div class='inline'>
|
3650
|
-
<p>the list of association names</p>
|
3651
|
-
</div>
|
3652
|
-
|
3653
|
-
</li>
|
3654
|
-
|
3655
|
-
</ul>
|
3656
3335
|
|
3657
3336
|
<p class="tag_title">See Also:</p>
|
3658
3337
|
<ul class="see">
|
3659
3338
|
|
3660
|
-
<li><span class='object_link'><a href="Sideload.html#
|
3339
|
+
<li><span class='object_link'><a href="Sideload.html#association_names-instance_method" title="JsonapiCompliable::Sideload#association_names (method)">Sideload#association_names</a></span></li>
|
3661
3340
|
|
3662
3341
|
</ul>
|
3663
3342
|
|
@@ -3667,27 +3346,15 @@ default.</p>
|
|
3667
3346
|
<pre class="lines">
|
3668
3347
|
|
3669
3348
|
|
3670
|
-
|
3671
|
-
|
3672
|
-
|
3673
|
-
584
|
3674
|
-
585
|
3675
|
-
586
|
3676
|
-
587
|
3677
|
-
588
|
3678
|
-
589</pre>
|
3349
|
+
541
|
3350
|
+
542
|
3351
|
+
543</pre>
|
3679
3352
|
</td>
|
3680
3353
|
<td>
|
3681
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3354
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 541</span>
|
3682
3355
|
|
3683
3356
|
<span class='kw'>def</span> <span class='id identifier rubyid_association_names'>association_names</span>
|
3684
|
-
<span class='
|
3685
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_sideloading'>sideloading</span>
|
3686
|
-
<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_sideloading'>sideloading</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span><span class='lbracket'>[</span><span class='symbol'>:base</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
3687
|
-
<span class='kw'>else</span>
|
3688
|
-
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
3689
|
-
<span class='kw'>end</span>
|
3690
|
-
<span class='kw'>end</span>
|
3357
|
+
<span class='id identifier rubyid_sideloading'>sideloading</span><span class='period'>.</span><span class='id identifier rubyid_association_names'>association_names</span>
|
3691
3358
|
<span class='kw'>end</span></pre>
|
3692
3359
|
</td>
|
3693
3360
|
</tr>
|
@@ -3803,12 +3470,12 @@ default.</p>
|
|
3803
3470
|
<pre class="lines">
|
3804
3471
|
|
3805
3472
|
|
3806
|
-
|
3807
|
-
|
3808
|
-
|
3473
|
+
453
|
3474
|
+
454
|
3475
|
+
455</pre>
|
3809
3476
|
</td>
|
3810
3477
|
<td>
|
3811
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3478
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 453</span>
|
3812
3479
|
|
3813
3480
|
<span class='kw'>def</span> <span class='id identifier rubyid_build_scope'>build_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
3814
3481
|
<span class='const'><span class='object_link'><a href="Scope.html" title="JsonapiCompliable::Scope (class)">Scope</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Scope.html#initialize-instance_method" title="JsonapiCompliable::Scope#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
@@ -3874,12 +3541,12 @@ href=":namespace">JsonapiCompliable.context</a>+</p>
|
|
3874
3541
|
<pre class="lines">
|
3875
3542
|
|
3876
3543
|
|
3877
|
-
|
3878
|
-
|
3879
|
-
|
3544
|
+
439
|
3545
|
+
440
|
3546
|
+
441</pre>
|
3880
3547
|
</td>
|
3881
3548
|
<td>
|
3882
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3549
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 439</span>
|
3883
3550
|
|
3884
3551
|
<span class='kw'>def</span> <span class='id identifier rubyid_context_namespace'>context_namespace</span>
|
3885
3552
|
<span class='const'><span class='object_link'><a href="../JsonapiCompliable.html" title="JsonapiCompliable (module)">JsonapiCompliable</a></span></span><span class='period'>.</span><span class='id identifier rubyid_context'><span class='object_link'><a href="../JsonapiCompliable.html#context-class_method" title="JsonapiCompliable.context (method)">context</a></span></span><span class='lbracket'>[</span><span class='symbol'>:namespace</span><span class='rbracket'>]</span>
|
@@ -3980,12 +3647,12 @@ instance.</p>
|
|
3980
3647
|
<pre class="lines">
|
3981
3648
|
|
3982
3649
|
|
3983
|
-
|
3984
|
-
|
3985
|
-
|
3650
|
+
472
|
3651
|
+
473
|
3652
|
+
474</pre>
|
3986
3653
|
</td>
|
3987
3654
|
<td>
|
3988
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3655
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 472</span>
|
3989
3656
|
|
3990
3657
|
<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_create_params'>create_params</span><span class='rparen'>)</span>
|
3991
3658
|
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='comma'>,</span> <span class='id identifier rubyid_create_params'>create_params</span><span class='rparen'>)</span>
|
@@ -4030,12 +3697,12 @@ instance.</p>
|
|
4030
3697
|
<pre class="lines">
|
4031
3698
|
|
4032
3699
|
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
3700
|
+
633
|
3701
|
+
634
|
3702
|
+
635</pre>
|
4036
3703
|
</td>
|
4037
3704
|
<td>
|
4038
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3705
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 633</span>
|
4039
3706
|
|
4040
3707
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_filters'>default_filters</span>
|
4041
3708
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_filters</span><span class='rbracket'>]</span>
|
@@ -4080,12 +3747,12 @@ instance.</p>
|
|
4080
3747
|
<pre class="lines">
|
4081
3748
|
|
4082
3749
|
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
3750
|
+
584
|
3751
|
+
585
|
3752
|
+
586</pre>
|
4086
3753
|
</td>
|
4087
3754
|
<td>
|
4088
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3755
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 584</span>
|
4089
3756
|
|
4090
3757
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_page_number'>default_page_number</span>
|
4091
3758
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_page_number</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>1</span>
|
@@ -4130,12 +3797,12 @@ instance.</p>
|
|
4130
3797
|
<pre class="lines">
|
4131
3798
|
|
4132
3799
|
|
4133
|
-
|
4134
|
-
|
4135
|
-
|
3800
|
+
590
|
3801
|
+
591
|
3802
|
+
592</pre>
|
4136
3803
|
</td>
|
4137
3804
|
<td>
|
4138
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3805
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 590</span>
|
4139
3806
|
|
4140
3807
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_page_size'>default_page_size</span>
|
4141
3808
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_page_size</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>20</span>
|
@@ -4180,12 +3847,12 @@ instance.</p>
|
|
4180
3847
|
<pre class="lines">
|
4181
3848
|
|
4182
3849
|
|
4183
|
-
|
4184
|
-
|
4185
|
-
|
3850
|
+
578
|
3851
|
+
579
|
3852
|
+
580</pre>
|
4186
3853
|
</td>
|
4187
3854
|
<td>
|
4188
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3855
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 578</span>
|
4189
3856
|
|
4190
3857
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_sort'>default_sort</span>
|
4191
3858
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:default_sort</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='lbrace'>{</span> <span class='label'>id:</span> <span class='symbol'>:asc</span> <span class='rbrace'>}</span><span class='rbracket'>]</span>
|
@@ -4287,12 +3954,12 @@ instance.</p>
|
|
4287
3954
|
<pre class="lines">
|
4288
3955
|
|
4289
3956
|
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
3957
|
+
511
|
3958
|
+
512
|
3959
|
+
513</pre>
|
4293
3960
|
</td>
|
4294
3961
|
<td>
|
4295
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
3962
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 511</span>
|
4296
3963
|
|
4297
3964
|
<span class='kw'>def</span> <span class='id identifier rubyid_destroy'>destroy</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
4298
3965
|
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_destroy'>destroy</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
@@ -4339,12 +4006,12 @@ instance.</p>
|
|
4339
4006
|
<pre class="lines">
|
4340
4007
|
|
4341
4008
|
|
4342
|
-
|
4343
|
-
|
4344
|
-
|
4009
|
+
529
|
4010
|
+
530
|
4011
|
+
531</pre>
|
4345
4012
|
</td>
|
4346
4013
|
<td>
|
4347
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4014
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 529</span>
|
4348
4015
|
|
4349
4016
|
<span class='kw'>def</span> <span class='id identifier rubyid_disassociate'>disassociate</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_child'>child</span><span class='comma'>,</span> <span class='id identifier rubyid_association_name'>association_name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
4350
4017
|
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_disassociate'>disassociate</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_child'>child</span><span class='comma'>,</span> <span class='id identifier rubyid_association_name'>association_name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
@@ -4389,12 +4056,12 @@ instance.</p>
|
|
4389
4056
|
<pre class="lines">
|
4390
4057
|
|
4391
4058
|
|
4392
|
-
|
4393
|
-
|
4394
|
-
|
4059
|
+
627
|
4060
|
+
628
|
4061
|
+
629</pre>
|
4395
4062
|
</td>
|
4396
4063
|
<td>
|
4397
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4064
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 627</span>
|
4398
4065
|
|
4399
4066
|
<span class='kw'>def</span> <span class='id identifier rubyid_extra_fields'>extra_fields</span>
|
4400
4067
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:extra_fields</span><span class='rbracket'>]</span>
|
@@ -4439,12 +4106,12 @@ instance.</p>
|
|
4439
4106
|
<pre class="lines">
|
4440
4107
|
|
4441
4108
|
|
4442
|
-
|
4443
|
-
|
4444
|
-
|
4109
|
+
603
|
4110
|
+
604
|
4111
|
+
605</pre>
|
4445
4112
|
</td>
|
4446
4113
|
<td>
|
4447
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4114
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 603</span>
|
4448
4115
|
|
4449
4116
|
<span class='kw'>def</span> <span class='id identifier rubyid_filters'>filters</span>
|
4450
4117
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:filters</span><span class='rbracket'>]</span>
|
@@ -4489,12 +4156,12 @@ instance.</p>
|
|
4489
4156
|
<pre class="lines">
|
4490
4157
|
|
4491
4158
|
|
4492
|
-
|
4493
|
-
|
4494
|
-
|
4159
|
+
639
|
4160
|
+
640
|
4161
|
+
641</pre>
|
4495
4162
|
</td>
|
4496
4163
|
<td>
|
4497
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4164
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 639</span>
|
4498
4165
|
|
4499
4166
|
<span class='kw'>def</span> <span class='id identifier rubyid_model'>model</span>
|
4500
4167
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:model</span><span class='rbracket'>]</span>
|
@@ -4539,12 +4206,12 @@ instance.</p>
|
|
4539
4206
|
<pre class="lines">
|
4540
4207
|
|
4541
4208
|
|
4542
|
-
|
4543
|
-
|
4544
|
-
|
4209
|
+
621
|
4210
|
+
622
|
4211
|
+
623</pre>
|
4545
4212
|
</td>
|
4546
4213
|
<td>
|
4547
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4214
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 621</span>
|
4548
4215
|
|
4549
4216
|
<span class='kw'>def</span> <span class='id identifier rubyid_pagination'>pagination</span>
|
4550
4217
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:pagination</span><span class='rbracket'>]</span>
|
@@ -4582,14 +4249,14 @@ instance.</p>
|
|
4582
4249
|
<pre class="lines">
|
4583
4250
|
|
4584
4251
|
|
4585
|
-
|
4586
|
-
|
4587
|
-
|
4588
|
-
|
4589
|
-
|
4252
|
+
534
|
4253
|
+
535
|
4254
|
+
536
|
4255
|
+
537
|
4256
|
+
538</pre>
|
4590
4257
|
</td>
|
4591
4258
|
<td>
|
4592
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4259
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 534</span>
|
4593
4260
|
|
4594
4261
|
<span class='kw'>def</span> <span class='id identifier rubyid_persist_with_relationships'>persist_with_relationships</span><span class='lparen'>(</span><span class='id identifier rubyid_meta'>meta</span><span class='comma'>,</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='comma'>,</span> <span class='id identifier rubyid_relationships'>relationships</span><span class='comma'>,</span> <span class='id identifier rubyid_caller_model'>caller_model</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
4595
4262
|
<span class='id identifier rubyid_persistence'>persistence</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../JsonapiCompliable.html" title="JsonapiCompliable (module)">JsonapiCompliable</a></span></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/Persistence.html" title="JsonapiCompliable::Util::Persistence (class)">Persistence</a></span></span> \
|
@@ -4709,12 +4376,12 @@ end</code></pre>
|
|
4709
4376
|
<pre class="lines">
|
4710
4377
|
|
4711
4378
|
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4379
|
+
681
|
4380
|
+
682
|
4381
|
+
683</pre>
|
4715
4382
|
</td>
|
4716
4383
|
<td>
|
4717
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4384
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 681</span>
|
4718
4385
|
|
4719
4386
|
<span class='kw'>def</span> <span class='id identifier rubyid_resolve'>resolve</span><span class='lparen'>(</span><span class='id identifier rubyid_scope'>scope</span><span class='rparen'>)</span>
|
4720
4387
|
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_resolve'>resolve</span><span class='lparen'>(</span><span class='id identifier rubyid_scope'>scope</span><span class='rparen'>)</span>
|
@@ -4764,56 +4431,6 @@ end</code></pre>
|
|
4764
4431
|
</td>
|
4765
4432
|
</tr>
|
4766
4433
|
</table>
|
4767
|
-
</div>
|
4768
|
-
|
4769
|
-
<div class="method_details ">
|
4770
|
-
<h3 class="signature " id="sideload_whitelist-instance_method">
|
4771
|
-
|
4772
|
-
#<strong>sideload_whitelist</strong> ⇒ <tt>Object</tt>
|
4773
|
-
|
4774
|
-
|
4775
|
-
|
4776
|
-
|
4777
|
-
|
4778
|
-
</h3><div class="docstring">
|
4779
|
-
<div class="discussion">
|
4780
|
-
<p class="note private">
|
4781
|
-
<strong>This method is part of a private API.</strong>
|
4782
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
4783
|
-
</p>
|
4784
|
-
|
4785
|
-
|
4786
|
-
</div>
|
4787
|
-
</div>
|
4788
|
-
<div class="tags">
|
4789
|
-
|
4790
|
-
|
4791
|
-
<p class="tag_title">See Also:</p>
|
4792
|
-
<ul class="see">
|
4793
|
-
|
4794
|
-
<li><span class='object_link'><a href="#sideload_whitelist-class_method" title="JsonapiCompliable::Resource.sideload_whitelist (method)">sideload_whitelist</a></span></li>
|
4795
|
-
|
4796
|
-
</ul>
|
4797
|
-
|
4798
|
-
</div><table class="source_code">
|
4799
|
-
<tr>
|
4800
|
-
<td>
|
4801
|
-
<pre class="lines">
|
4802
|
-
|
4803
|
-
|
4804
|
-
715
|
4805
|
-
716
|
4806
|
-
717</pre>
|
4807
|
-
</td>
|
4808
|
-
<td>
|
4809
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 715</span>
|
4810
|
-
|
4811
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_sideload_whitelist'>sideload_whitelist</span>
|
4812
|
-
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:sideload_whitelist</span><span class='rbracket'>]</span>
|
4813
|
-
<span class='kw'>end</span></pre>
|
4814
|
-
</td>
|
4815
|
-
</tr>
|
4816
|
-
</table>
|
4817
4434
|
</div>
|
4818
4435
|
|
4819
4436
|
<div class="method_details ">
|
@@ -4846,12 +4463,12 @@ end</code></pre>
|
|
4846
4463
|
<pre class="lines">
|
4847
4464
|
|
4848
4465
|
|
4849
|
-
|
4850
|
-
|
4851
|
-
|
4466
|
+
572
|
4467
|
+
573
|
4468
|
+
574</pre>
|
4852
4469
|
</td>
|
4853
4470
|
<td>
|
4854
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4471
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 572</span>
|
4855
4472
|
|
4856
4473
|
<span class='kw'>def</span> <span class='id identifier rubyid_sideloading'>sideloading</span>
|
4857
4474
|
<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_sideloading'>sideloading</span>
|
@@ -4896,12 +4513,12 @@ end</code></pre>
|
|
4896
4513
|
<pre class="lines">
|
4897
4514
|
|
4898
4515
|
|
4899
|
-
|
4900
|
-
|
4901
|
-
|
4516
|
+
609
|
4517
|
+
610
|
4518
|
+
611</pre>
|
4902
4519
|
</td>
|
4903
4520
|
<td>
|
4904
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4521
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 609</span>
|
4905
4522
|
|
4906
4523
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorting'>sorting</span>
|
4907
4524
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:sorting</span><span class='rbracket'>]</span>
|
@@ -5033,14 +4650,14 @@ resource.stat(:rating, :average)
|
|
5033
4650
|
<pre class="lines">
|
5034
4651
|
|
5035
4652
|
|
5036
|
-
|
5037
|
-
|
5038
|
-
|
5039
|
-
|
5040
|
-
|
4653
|
+
564
|
4654
|
+
565
|
4655
|
+
566
|
4656
|
+
567
|
4657
|
+
568</pre>
|
5041
4658
|
</td>
|
5042
4659
|
<td>
|
5043
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4660
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 564</span>
|
5044
4661
|
|
5045
4662
|
<span class='kw'>def</span> <span class='id identifier rubyid_stat'>stat</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_calculation'>calculation</span><span class='rparen'>)</span>
|
5046
4663
|
<span class='id identifier rubyid_stats_dsl'>stats_dsl</span> <span class='op'>=</span> <span class='id identifier rubyid_stats'>stats</span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_stats'>stats</span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
@@ -5087,12 +4704,12 @@ resource.stat(:rating, :average)
|
|
5087
4704
|
<pre class="lines">
|
5088
4705
|
|
5089
4706
|
|
5090
|
-
|
5091
|
-
|
5092
|
-
|
4707
|
+
615
|
4708
|
+
616
|
4709
|
+
617</pre>
|
5093
4710
|
</td>
|
5094
4711
|
<td>
|
5095
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4712
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 615</span>
|
5096
4713
|
|
5097
4714
|
<span class='kw'>def</span> <span class='id identifier rubyid_stats'>stats</span>
|
5098
4715
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:stats</span><span class='rbracket'>]</span>
|
@@ -5170,19 +4787,19 @@ rather than override this directly.</p>
|
|
5170
4787
|
<pre class="lines">
|
5171
4788
|
|
5172
4789
|
|
5173
|
-
|
5174
|
-
|
5175
|
-
|
5176
|
-
|
5177
|
-
|
5178
|
-
|
5179
|
-
|
5180
|
-
|
5181
|
-
|
5182
|
-
|
4790
|
+
701
|
4791
|
+
702
|
4792
|
+
703
|
4793
|
+
704
|
4794
|
+
705
|
4795
|
+
706
|
4796
|
+
707
|
4797
|
+
708
|
4798
|
+
709
|
4799
|
+
710</pre>
|
5183
4800
|
</td>
|
5184
4801
|
<td>
|
5185
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4802
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 701</span>
|
5186
4803
|
|
5187
4804
|
<span class='kw'>def</span> <span class='id identifier rubyid_transaction'>transaction</span>
|
5188
4805
|
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
@@ -5236,12 +4853,12 @@ rather than override this directly.</p>
|
|
5236
4853
|
<pre class="lines">
|
5237
4854
|
|
5238
4855
|
|
5239
|
-
|
5240
|
-
|
5241
|
-
|
4856
|
+
597
|
4857
|
+
598
|
4858
|
+
599</pre>
|
5242
4859
|
</td>
|
5243
4860
|
<td>
|
5244
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4861
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 597</span>
|
5245
4862
|
|
5246
4863
|
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
5247
4864
|
<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_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:undefined_jsonapi_type</span>
|
@@ -5342,12 +4959,12 @@ instance.</p>
|
|
5342
4959
|
<pre class="lines">
|
5343
4960
|
|
5344
4961
|
|
5345
|
-
|
5346
|
-
|
5347
|
-
|
4962
|
+
491
|
4963
|
+
492
|
4964
|
+
493</pre>
|
5348
4965
|
</td>
|
5349
4966
|
<td>
|
5350
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
4967
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 491</span>
|
5351
4968
|
|
5352
4969
|
<span class='kw'>def</span> <span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_update_params'>update_params</span><span class='rparen'>)</span>
|
5353
4970
|
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='comma'>,</span> <span class='id identifier rubyid_update_params'>update_params</span><span class='rparen'>)</span>
|
@@ -5450,14 +5067,14 @@ Rails controller context</p>
|
|
5450
5067
|
<pre class="lines">
|
5451
5068
|
|
5452
5069
|
|
5453
|
-
|
5454
|
-
|
5455
|
-
|
5456
|
-
|
5457
|
-
|
5070
|
+
415
|
5071
|
+
416
|
5072
|
+
417
|
5073
|
+
418
|
5074
|
+
419</pre>
|
5458
5075
|
</td>
|
5459
5076
|
<td>
|
5460
|
-
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line
|
5077
|
+
<pre class="code"><span class="info file"># File 'lib/jsonapi_compliable/resource.rb', line 415</span>
|
5461
5078
|
|
5462
5079
|
<span class='kw'>def</span> <span class='id identifier rubyid_with_context'>with_context</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_namespace'>namespace</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
5463
5080
|
<span class='const'><span class='object_link'><a href="../JsonapiCompliable.html" title="JsonapiCompliable (module)">JsonapiCompliable</a></span></span><span class='period'>.</span><span class='id identifier rubyid_with_context'><span class='object_link'><a href="../JsonapiCompliable.html#with_context-class_method" title="JsonapiCompliable.with_context (method)">with_context</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_namespace'>namespace</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
@@ -5474,7 +5091,7 @@ Rails controller context</p>
|
|
5474
5091
|
</div>
|
5475
5092
|
|
5476
5093
|
<div id="footer">
|
5477
|
-
Generated on
|
5094
|
+
Generated on Tue Oct 3 09:22:26 2017 by
|
5478
5095
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
5479
5096
|
0.9.9 (ruby-2.3.0).
|
5480
5097
|
</div>
|