Skip to content

Commit ef77d40

Browse files
committed
Remove block argument from callback example.
[ci skip]
1 parent 3af7b16 commit ef77d40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/active_record_callbacks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ The macro-style class methods can also receive a block. Consider using this styl
4949
class User < ActiveRecord::Base
5050
validates :login, :email, presence: true
5151

52-
before_create do |user|
53-
user.name = user.login.capitalize if user.name.blank?
52+
before_create do
53+
self.name = login.capitalize if name.blank?
5454
end
5555
end
5656
```

0 commit comments

Comments
 (0)