Fixed validates_is_numeric when dealing with an actual float

This commit is contained in:
Rob Kaufman 2009-07-07 17:20:53 -07:00 committed by Matt Aimonetti
parent 82090cb780
commit baabe40674

View file

@ -40,7 +40,7 @@ module CouchRest
value = target.send(field_name)
return true if @options[:allow_nil] && value.nil?
value = value.kind_of?(Float) ? value.to_s('F') : value.to_s
value = (defined?(BigDecimal) && value.kind_of?(BigDecimal)) ? value.to_s('F') : value.to_s
error_message = @options[:message]
precision = @options[:precision]