From 8e3c3b06dc8ff8842f6390efc58eaf4bb1a23060 Mon Sep 17 00:00:00 2001 From: rohit Date: Tue, 18 May 2010 06:09:45 +0530 Subject: Fixed numericality validator in ActiveModel to reject hex numbers for floats completely [#4622 state:commited] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activemodel/lib/active_model/validations/numericality.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib/active_model/validations') 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 -- cgit v1.2.3