aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-07-16 04:53:51 +0900
committerGitHub <noreply@github.com>2018-07-16 04:53:51 +0900
commitab9ad981cf896ebdaa1e98e929291b4be46616f8 (patch)
tree71eec9fe3066eb163b681b291e14b051aff1fb22
parent05bef140519fe3410fd8d352f5ea84fd1a278063 (diff)
parent6c7c49fb6aa19a0efb937437ea4bec67e346b7c3 (diff)
downloadrails-ab9ad981cf896ebdaa1e98e929291b4be46616f8.tar.gz
rails-ab9ad981cf896ebdaa1e98e929291b4be46616f8.tar.bz2
rails-ab9ad981cf896ebdaa1e98e929291b4be46616f8.zip
Merge pull request #33365 from lanzhiheng/fix-document-issue-about-active-record-callbacks-after_touch
Fix document issue in active record callback about `after_touch` hook. [ci skip]
-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
```