Browse files

fix block alignment

  • Loading branch information...
1 parent b22f39e commit e46e106c547054d4c6a898012e78b6ccfc835254 @vijaydev vijaydev committed Apr 23, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 railties/guides/source/active_record_validations_callbacks.textile
View
5 railties/guides/source/active_record_validations_callbacks.textile
@@ -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>

0 comments on commit e46e106

Please sign in to comment.