diff options
author | Agis Anastasopoulos <corestudiosinc@gmail.com> | 2012-11-15 23:09:28 +0200 |
---|---|---|
committer | Agis Anastasopoulos <corestudiosinc@gmail.com> | 2012-11-15 23:09:28 +0200 |
commit | ba280c6ea1aae275756b8075ff34b39d085aaf8b (patch) | |
tree | e97bed9d802cd705e2c3645846553b2be0cf6567 /guides/source | |
parent | 204d3afb2ad33dbc8ae1e7a3c94adc41effe7907 (diff) | |
download | rails-ba280c6ea1aae275756b8075ff34b39d085aaf8b.tar.gz rails-ba280c6ea1aae275756b8075ff34b39d085aaf8b.tar.bz2 rails-ba280c6ea1aae275756b8075ff34b39d085aaf8b.zip |
Switch to 1.9 hash syntax
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_model_basics.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/active_model_basics.md b/guides/source/active_model_basics.md index bfb088ed03..92b51334a3 100644 --- a/guides/source/active_model_basics.md +++ b/guides/source/active_model_basics.md @@ -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' |