aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorrohit <rohit.arondekar@gmail.com>2010-05-18 06:09:45 +0530
committerJosé Valim <jose.valim@gmail.com>2010-05-18 03:10:56 +0200
commit8e3c3b06dc8ff8842f6390efc58eaf4bb1a23060 (patch)
tree039bab343a3a8c63fccf2b10bf646c39a73d83a5 /activemodel
parent05e3fb45eeacd20f2b8b5691f17d6fdf2fb4582b (diff)
downloadrails-8e3c3b06dc8ff8842f6390efc58eaf4bb1a23060.tar.gz
rails-8e3c3b06dc8ff8842f6390efc58eaf4bb1a23060.tar.bz2
rails-8e3c3b06dc8ff8842f6390efc58eaf4bb1a23060.zip
Fixed numericality validator in ActiveModel to reject hex numbers for floats completely [#4622 state:commited]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/validations/numericality.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb
index ac8308b0d7..062b4cd17f 100644
--- a/activemodel/lib/active_model/validations/numericality.rb
+++ b/activemodel/lib/active_model/validations/numericality.rb
@@ -58,7 +58,7 @@ module ActiveModel
def parse_raw_value_as_a_number(raw_value)
case raw_value
- when /\A0x/
+ when /\A0[xX]/
nil
else
begin