File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 33## Unreleased
44
55- [ #338 ] ( https://github.com/JsonApiClient/json_api_client/pull/338 ) - implement hash and eql? for builder class
6+ - [ #351 ] ( https://github.com/JsonApiClient/json_api_client/pull/351 ) - Remove rudimental ` last_result_set ` relationship from serializer
67
78## 1.13.0
89
Original file line number Diff line number Diff line change @@ -458,7 +458,6 @@ def save
458458 self . attributes = updated . attributes
459459 self . links . attributes = updated . links . attributes
460460 self . relationships . attributes = updated . relationships . attributes
461- self . relationships . last_result_set = last_result_set
462461 clear_changes_information
463462 self . relationships . clear_changes_information
464463 _clear_cached_relationships
@@ -477,7 +476,6 @@ def destroy
477476 false
478477 else
479478 mark_as_destroyed!
480- self . relationships . last_result_set = nil
481479 _clear_cached_relationships
482480 _clear_belongs_to_params
483481 true
Original file line number Diff line number Diff line change @@ -52,6 +52,29 @@ def test_as_json
5252 assert_equal expected , resource . first . as_json
5353 end
5454
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+
5578 def test_as_json_api
5679 expected = {
5780 'type' => 'articles' ,
You can’t perform that action at this time.
0 commit comments