Skip to content

Commit

Permalink
Switch to 1.9 hash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
agis committed Nov 15, 2012
1 parent 204d3af commit ba280c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guides/source/active_model_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ class Person

attr_accessor :name, :email, :token

validates :name, :presence => true
validates_format_of :email, :with => /\A([^\s]+)((?:[-a-z0-9]\.)[a-z]{2,})\z/i
validates! :token, :presence => true
validates :name, presence: true
validates_format_of :email, with: /\A([^\s]+)((?:[-a-z0-9]\.)[a-z]{2,})\z/i
validates! :token, presence: true

end

person = Person.new(:token => "2b1f325")
person = Person.new(token: "2b1f325")
person.valid? #=> false
person.name = 'vishnu'
person.email = 'me'
Expand Down

0 comments on commit ba280c6

Please sign in to comment.