Skip to content

Commit 6aa44c8

Browse files
gstarkrichmolj
authored andcommitted
Updates documentation to match implementation (graphiti-api#26)
The save/destroy override examples should reflect that the model instance is returned
1 parent 2198e29 commit 6aa44c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

guides/concepts/resources.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,13 +1476,16 @@ class PostResource < ApplicationResource
14761476
# By default, we'd call adapter.save(model_instance)
14771477
def save(model_instance)
14781478
model_instance.save
1479+
model_instance
14791480
end
14801481

1482+
14811483
# This is an *override*
14821484
# During #destroy, actually save the model instance
14831485
# By default, we'd call adapter.destroy(model_instance)
14841486
def delete(model_instance)
1485-
model.destroy
1487+
model_instance.destroy
1488+
model_instance
14861489
end
14871490

14881491
# Finally, you may want to hook around *all* the above steps:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy