aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorlanzhiheng <lanzhihengrj@gmail.com>2018-07-15 17:21:31 +0800
committerlanzhiheng <lanzhihengrj@gmail.com>2018-07-15 17:31:39 +0800
commit6c7c49fb6aa19a0efb937437ea4bec67e346b7c3 (patch)
tree71eec9fe3066eb163b681b291e14b051aff1fb22 /guides
parent05bef140519fe3410fd8d352f5ea84fd1a278063 (diff)
downloadrails-6c7c49fb6aa19a0efb937437ea4bec67e346b7c3.tar.gz
rails-6c7c49fb6aa19a0efb937437ea4bec67e346b7c3.tar.bz2
rails-6c7c49fb6aa19a0efb937437ea4bec67e346b7c3.zip
Fix document issue in active record callback about `after_touch` hook.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_callbacks.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md
index 0f74daace6..379c0925b5 100644
--- a/guides/source/active_record_callbacks.md
+++ b/guides/source/active_record_callbacks.md
@@ -184,9 +184,9 @@ class Company < ApplicationRecord
after_touch :log_when_employees_or_company_touched
private
- def log_when_employees_or_company_touched
- puts 'Employee/Company was touched'
- end
+ def log_when_employees_or_company_touched
+ puts 'Employee/Company was touched'
+ end
end
>> @employee = Employee.last
@@ -194,8 +194,8 @@ end
# triggers @employee.company.touch
>> @employee.touch
-Employee/Company was touched
An Employee was touched
+Employee/Company was touched
=> true
```