From 8422465fc3def09c0dfc6817c216edd71b409374 Mon Sep 17 00:00:00 2001 From: Anil Wadghule Date: Mon, 17 May 2010 18:23:50 +0530 Subject: [PATCH] Fix for validates_numericality_of failing tests with Ruby 1.9.2 [#4622 state:resolved] --- .../lib/active_model/validations/numericality.rb | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index 716010e..427f34c 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -58,6 +58,7 @@ module ActiveModel def parse_raw_value_as_a_number(raw_value) begin + raise TypeError if raw_value =~ /^0x/ Kernel.Float(raw_value) rescue ArgumentError, TypeError nil -- 1.6.6.1