Skip to content

Commit 2840b44

Browse files
committed
Merge pull request rails#11413 from envylabs/master
Remove block argument from callback example. [ci skip]
2 parents 6878d49 + ef77d40 commit 2840b44

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)