Skip to content

Commit 3c8edef

Browse files
committed
readme update; changelog update; version bump v1.6.4
1 parent 147ec71 commit 3c8edef

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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`

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,29 @@ MyApi::Article.where(author_id: 1).all
3939
MyApi::Person.where(name: "foo").order(created_at: :desc).includes(:preferences, :cars).all
4040

4141
u = MyApi::Person.new(first_name: "bar", last_name: "foo")
42+
u.new_record?
43+
# => true
4244
u.save
4345

46+
u.new_record?
47+
# => false
48+
4449
u = MyApi::Person.find(1).first
4550
u.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+
5065
u = MyApi::Person.create(
5166
a: "b",
5267
c: "d"

lib/json_api_client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JsonApiClient
2-
VERSION = "1.6.3"
2+
VERSION = "1.6.4"
33
end

0 commit comments

Comments
 (0)