diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-07-13 08:05:08 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-07-13 08:05:08 -0700 |
commit | 2840b4436ea57c6ffdc966f5c18108dfdf43ac8e (patch) | |
tree | 4d59735a842156424d95f3ac4cebdc0829709433 /guides | |
parent | 6878d49a3df9b03111c59466726ff70b96a4e199 (diff) | |
parent | ef77d40649b04dff4c935418ef2782c131fc7ef6 (diff) | |
download | rails-2840b4436ea57c6ffdc966f5c18108dfdf43ac8e.tar.gz rails-2840b4436ea57c6ffdc966f5c18108dfdf43ac8e.tar.bz2 rails-2840b4436ea57c6ffdc966f5c18108dfdf43ac8e.zip |
Merge pull request #11413 from envylabs/master
Remove block argument from callback example. [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_callbacks.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md index 2e70e64b39..df1dd22971 100644 --- a/guides/source/active_record_callbacks.md +++ b/guides/source/active_record_callbacks.md @@ -49,8 +49,8 @@ The macro-style class methods can also receive a block. Consider using this styl class User < ActiveRecord::Base validates :login, :email, presence: true - before_create do |user| - user.name = user.login.capitalize if user.name.blank? + before_create do + self.name = login.capitalize if name.blank? end end ``` |