File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ ## v1.6.4
6+ - [ #314 ] ( https://github.com/JsonApiClient/json_api_client/pull/314 ) - Mimic ActiveRecord behavior when destroying a resource:
7+ * Add ` destroyed? ` method
8+ * Do not clear resource attributes
9+ * Return ` false ` on ` persisted? ` after being destroyed
10+ * Return ` false ` on ` new_record? ` after being destroyed
11+
512## v1.6.3
613
714- [ #312 ] ( https://githup.com/JsonApiClient/json_api_client/pull/312 ) - Don't raise on ` 422 `
Original file line number Diff line number Diff line change @@ -39,14 +39,29 @@ MyApi::Article.where(author_id: 1).all
3939MyApi ::Person .where(name: " foo" ).order(created_at: :desc ).includes(:preferences , :cars ).all
4040
4141u = MyApi ::Person .new (first_name: " bar" , last_name: " foo" )
42+ u.new_record?
43+ # => true
4244u.save
4345
46+ u.new_record?
47+ # => false
48+
4449u = MyApi ::Person .find(1 ).first
4550u.update_attributes(
4651 a: " b" ,
4752 c: " d"
4853)
4954
55+ u.persisted?
56+ # => true
57+
58+ u.destroy
59+
60+ u.destroyed?
61+ # => true
62+ u.persisted?
63+ # => false
64+
5065u = MyApi ::Person .create(
5166 a: " b" ,
5267 c: " d"
Original file line number Diff line number Diff line change 11module JsonApiClient
2- VERSION = "1.6.3 "
2+ VERSION = "1.6.4 "
33end
You can’t perform that action at this time.
0 commit comments