aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2016-06-14 15:28:54 +0200
committerGitHub <noreply@github.com>2016-06-14 15:28:54 +0200
commit5dfaf73d79be40578031c5e9d1a130fdd62a4cdc (patch)
tree7af4d6ae8724c2833e34a92cf95bf5d7aaa30391 /guides
parentf27a932d6f0a3c991c3e8b1968236c79f2c1936a (diff)
parentc4861cc67dd62f0e6d8653d21ea9055036d66953 (diff)
downloadrails-5dfaf73d79be40578031c5e9d1a130fdd62a4cdc.tar.gz
rails-5dfaf73d79be40578031c5e9d1a130fdd62a4cdc.tar.bz2
rails-5dfaf73d79be40578031c5e9d1a130fdd62a4cdc.zip
Merge pull request #25399 from wynksaiddestroy/fix-typo-and-simply-after-commit-example
[skip ci] Fix typo and simplify after_commit example
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_callbacks.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md
index fb5d2065d3..a7975c7772 100644
--- a/guides/source/active_record_callbacks.md
+++ b/guides/source/active_record_callbacks.md
@@ -399,7 +399,7 @@ By using the `after_commit` callback we can account for this case.
```ruby
class PictureFile < ApplicationRecord
- after_commit :delete_picture_file_from_disk, on: [:destroy]
+ after_commit :delete_picture_file_from_disk, on: :destroy
def delete_picture_file_from_disk
if File.exist?(filepath)
@@ -409,7 +409,7 @@ class PictureFile < ApplicationRecord
end
```
-NOTE: the `:on` option specifies when a callback will be fired. If you
+NOTE: The `:on` option specifies when a callback will be fired. If you
don't supply the `:on` option the callback will fire for every action.
Since using `after_commit` callback only on create, update or delete is