diff options
author | CassioMarques <cassiommc@gmail.com> | 2008-12-08 18:02:47 -0200 |
---|---|---|
committer | CassioMarques <cassiommc@gmail.com> | 2008-12-08 18:02:47 -0200 |
commit | dce92e6d10bfe55b9e2b97dc0165fd7c4e25f37d (patch) | |
tree | dbae2e4c51e012186b9be05c068d0e998bc947e9 /railties/doc | |
parent | c942eccfa00b4be3d10b9b9629879d5ea7185122 (diff) | |
download | rails-dce92e6d10bfe55b9e2b97dc0165fd7c4e25f37d.tar.gz rails-dce92e6d10bfe55b9e2b97dc0165fd7c4e25f37d.tar.bz2 rails-dce92e6d10bfe55b9e2b97dc0165fd7c4e25f37d.zip |
Fixed typos on validates_numericality_of all over AR validations and callbacks guide
Diffstat (limited to 'railties/doc')
-rw-r--r-- | railties/doc/guides/source/activerecord_validations_callbacks.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/doc/guides/source/activerecord_validations_callbacks.txt b/railties/doc/guides/source/activerecord_validations_callbacks.txt index 0c82f24e66..12db36f9be 100644 --- a/railties/doc/guides/source/activerecord_validations_callbacks.txt +++ b/railties/doc/guides/source/activerecord_validations_callbacks.txt @@ -223,7 +223,7 @@ end This helper has an alias called +validates_size_of+, it's the same helper with a different name. You can use it if you'd like to. -=== The +validates_numericallity_of+ helper +=== The +validates_numericality_of+ helper This helper validates that your attributes have only numeric values. By default, it will match an optional sign followed by a integral or floating point number. Using the +:integer_only+ option set to true, you can specify that only integral numbers are allowed. @@ -232,12 +232,12 @@ If you use +:integer_only+ set to +true+, then it will use the +$$/\A[+\-]?\d+\Z [source, ruby] ------------------------------------------------------------------ class Player < ActiveRecord::Base - validates_numericallity_of :points - validates_numericallity_of :games_played, :integer_only => true + validates_numericality_of :points + validates_numericality_of :games_played, :integer_only => true end ------------------------------------------------------------------ -The default error message for +validates_numericallity_of+ is "_is not a number_". +The default error message for +validates_numericality_of+ is "_is not a number_". === The +validates_presence_of+ helper @@ -325,7 +325,7 @@ As stated before, the +:on+ option lets you specify when the validation should h ------------------------------------------------------------------ class Person < ActiveRecord::Base validates_uniqueness_of :email, :on => :create # => it will be possible to update email with a duplicated value - validates_numericallity_of :age, :on => :update # => it will be possible to create the record with a 'non-numerical age' + validates_numericality_of :age, :on => :update # => it will be possible to create the record with a 'non-numerical age' validates_presence_of :name, :on => :save # => that's the default end ------------------------------------------------------------------ |