Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed typos on validates_numericality_of all over AR validations and …

…callbacks guide
  • Loading branch information...
commit dce92e6d10bfe55b9e2b97dc0165fd7c4e25f37d 1 parent c942ecc
Cássio Marques authored December 08, 2008
10  railties/doc/guides/source/activerecord_validations_callbacks.txt
@@ -223,7 +223,7 @@ end
223 223
 
224 224
 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.
225 225
 
226  
-=== The +validates_numericallity_of+ helper
  226
+=== The +validates_numericality_of+ helper
227 227
 
228 228
 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.
229 229
 
@@ -232,12 +232,12 @@ If you use +:integer_only+ set to +true+, then it will use the +$$/\A[+\-]?\d+\Z
232 232
 [source, ruby]
233 233
 ------------------------------------------------------------------
234 234
 class Player < ActiveRecord::Base
235  
-  validates_numericallity_of :points
236  
-  validates_numericallity_of :games_played, :integer_only => true
  235
+  validates_numericality_of :points
  236
+  validates_numericality_of :games_played, :integer_only => true
237 237
 end
238 238
 ------------------------------------------------------------------
239 239
 
240  
-The default error message for +validates_numericallity_of+ is "_is not a number_".
  240
+The default error message for +validates_numericality_of+ is "_is not a number_".
241 241
 
242 242
 === The +validates_presence_of+ helper
243 243
 
@@ -325,7 +325,7 @@ As stated before, the +:on+ option lets you specify when the validation should h
325 325
 ------------------------------------------------------------------
326 326
 class Person < ActiveRecord::Base
327 327
   validates_uniqueness_of :email, :on => :create # => it will be possible to update email with a duplicated value
328  
-  validates_numericallity_of :age, :on => :update # => it will be possible to create the record with a 'non-numerical age'
  328
+  validates_numericality_of :age, :on => :update # => it will be possible to create the record with a 'non-numerical age'
329 329
   validates_presence_of :name, :on => :save # => that's the default
330 330
 end
331 331
 ------------------------------------------------------------------

0 notes on commit dce92e6

Please sign in to comment.
Something went wrong with that request. Please try again.