Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11413 from envylabs/master

Remove block argument from callback example. [ci skip]
  • Loading branch information...
commit 2840b4436ea57c6ffdc966f5c18108dfdf43ac8e 2 parents 6878d49 + ef77d40
@senny senny authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/active_record_callbacks.md
View
4 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
```
Please sign in to comment.
Something went wrong with that request. Please try again.