Created
May 31, 2010 21:40
-
-
Save jamesgolick/420306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> s | |
| => #<Status id: 10, created_at: "2010-05-11 15:42:27", author_id: 129315, body: "bsdf", last_comment_at: "2010-05-15 16:01:16"> | |
| >> b | |
| => #<Status id: 10, created_at: "2010-05-11 15:42:27", author_id: 129315, body: "bsdf", last_comment_at: "2010-05-15 16:01:16"> | |
| >> s.destroy | |
| => #<Status id: 10, created_at: "2010-05-11 15:42:27", author_id: 129315, body: "bsdf", last_comment_at: "2010-05-15 16:01:16"> | |
| >> s.destroyed? | |
| => true | |
| >> b.destroy | |
| => #<Status id: 10, created_at: "2010-05-11 15:42:27", author_id: 129315, body: "bsdf", last_comment_at: "2010-05-15 16:01:16"> | |
| >> b.destroyed? | |
| => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think http://gist.github.com/420314 does something like what you're looking for, but there's really three different questions "destroyed?" might ask -- one is "has the record this instance represents been destroyed?," another is "was the destroy action successful" and the third "has destroy been called on this record?" Rails currently answers the last one. You want the second one, which is what the patch provides.