aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_callbacks.md
diff options
context:
space:
mode:
authorAlberto Almagro <albertoalmagro@gmail.com>2019-04-23 12:03:00 +0200
committerAlberto Almagro <albertoalmagro@gmail.com>2019-04-23 12:11:43 +0200
commit0c349abeb036d02c5e32ff4a84d095f5b5b6bdb2 (patch)
tree1992af808befde6c2c4996e96eace3de18d8c346 /guides/source/active_record_callbacks.md
parent9d1f9b9a0c344dd8f4b6b321a3fe8e9f500f841c (diff)
downloadrails-0c349abeb036d02c5e32ff4a84d095f5b5b6bdb2.tar.gz
rails-0c349abeb036d02c5e32ff4a84d095f5b5b6bdb2.tar.bz2
rails-0c349abeb036d02c5e32ff4a84d095f5b5b6bdb2.zip
Remove reminiscences from previous documentation [ci skip]
In #35861 documentation for `after_save_commit` was added, but also old documentation was adapted. I think adapting the old documentation is not necessary because there are already examples for `after_commit` on `:destroy` above. On top of that the action invoked by the callback on `:destroy` (`:log_user_saved_to_db`) talks about saving when the object is destroyed, which can be misleading. As I believe the documentation added by #35861 is already enough this patch removes the modified part, which made sense before adding docs for `after_save_commit` but is already covered by other parts of this guide.
Diffstat (limited to 'guides/source/active_record_callbacks.md')
-rw-r--r--guides/source/active_record_callbacks.md8
1 files changed, 0 insertions, 8 deletions
diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md
index 8f54e78224..617f81d37b 100644
--- a/guides/source/active_record_callbacks.md
+++ b/guides/source/active_record_callbacks.md
@@ -495,11 +495,3 @@ end
>> @user.save
=> User was saved to database
```
-
-To register callbacks for both create and destroy actions, use `after_commit` instead.
-
-```ruby
-class User < ApplicationRecord
- after_commit :log_user_saved_to_db, on: [:create, :destroy]
-end
-```