提交 ef77d406 编写于 作者: C Carlos Souza

Remove block argument from callback example.

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