mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove block argument from callback example.
[ci skip]
This commit is contained in:
parent
3af7b16c11
commit
ef77d40649
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue