File tree 3 files changed +25
-2
lines changed
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ - [ #351 ] ( https://github.com/JsonApiClient/json_api_client/pull/351 ) - Remove rudimental ` last_result_set ` relationship from serializer
6
+
5
7
## 1.12.2
6
8
7
9
- [ #350 ] ( https://github.com/JsonApiClient/json_api_client/pull/350 ) - fix resource including with blank ` relationships ` response data
Original file line number Diff line number Diff line change @@ -458,7 +458,6 @@ def save
458
458
self . attributes = updated . attributes
459
459
self . links . attributes = updated . links . attributes
460
460
self . relationships . attributes = updated . relationships . attributes
461
- self . relationships . last_result_set = last_result_set
462
461
clear_changes_information
463
462
self . relationships . clear_changes_information
464
463
_clear_cached_relationships
@@ -477,7 +476,6 @@ def destroy
477
476
false
478
477
else
479
478
mark_as_destroyed!
480
- self . relationships . last_result_set = nil
481
479
_clear_cached_relationships
482
480
_clear_belongs_to_params
483
481
true
Original file line number Diff line number Diff line change @@ -52,6 +52,29 @@ def test_as_json
52
52
assert_equal expected , resource . first . as_json
53
53
end
54
54
55
+ def test_as_json_involving_last_result_set
56
+ expected = {
57
+ 'type' => 'articles' ,
58
+ 'id' => '1' ,
59
+ 'attributes' => {
60
+ 'title' => 'Rails is Omakase'
61
+ }
62
+ }
63
+ stub_request ( :post , "http://example.com/articles" )
64
+ . to_return ( headers : { content_type : "application/vnd.api+json" } , body : {
65
+ data : [ {
66
+ type : "articles" ,
67
+ id : "1" ,
68
+ attributes : {
69
+ title : "Rails is Omakase"
70
+ }
71
+ } ]
72
+ } . to_json )
73
+
74
+ resource = Article . create
75
+ assert_equal expected , resource . as_json
76
+ end
77
+
55
78
def test_as_json_api
56
79
expected = {
57
80
'type' => 'articles' ,
You can’t perform that action at this time.
0 commit comments