mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fix block alignment
This commit is contained in:
parent
b22f39ec6f
commit
e46e106c54
1 changed files with 3 additions and 2 deletions
|
@ -897,8 +897,9 @@ The macro-style class methods can also receive a block. Consider using this styl
|
|||
class User < ActiveRecord::Base
|
||||
validates_presence_of :login, :email
|
||||
|
||||
before_create {|user| user.name = user.login.capitalize
|
||||
if user.name.blank?}
|
||||
before_create do |user|
|
||||
user.name = user.login.capitalize if user.name.blank?
|
||||
end
|
||||
end
|
||||
</ruby>
|
||||
|
||||
|
|
Loading…
Reference in a new issue