未验证 提交 ab9ad981 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #33365 from...

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]
......@@ -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
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册