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
|
class User < ActiveRecord::Base
|
||||||
validates_presence_of :login, :email
|
validates_presence_of :login, :email
|
||||||
|
|
||||||
before_create {|user| user.name = user.login.capitalize
|
before_create do |user|
|
||||||
if user.name.blank?}
|
user.name = user.login.capitalize if user.name.blank?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue