<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -855,7 +855,7 @@ module ActiveRecord
             raw_value = raw_value.to_i
           else
            begin
-              raw_value = Kernel.Float(raw_value.to_s)
+              raw_value = Kernel.Float(raw_value)
             rescue ArgumentError, TypeError
               record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default_error_messages[:not_a_number])
               next</diff>
      <filename>activerecord/lib/active_record/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1391,6 +1391,7 @@ class ValidatesNumericalityTest &lt; ActiveRecord::TestCase
   INTEGERS = [0, 10, -10] + INTEGER_STRINGS
   BIGDECIMAL = BIGDECIMAL_STRINGS.collect! { |bd| BigDecimal.new(bd) }
   JUNK = [&quot;not a number&quot;, &quot;42 not a number&quot;, &quot;0xdeadbeef&quot;, &quot;00-1&quot;, &quot;--3&quot;, &quot;+-3&quot;, &quot;+3-1&quot;, &quot;-+019.0&quot;, &quot;12.12.13.12&quot;, &quot;123\nnot a number&quot;]
+  INFINITY = [1.0/0.0]
 
   def setup
     Topic.instance_variable_set(&quot;@validate_callbacks&quot;, ActiveSupport::Callbacks::CallbackChain.new)
@@ -1402,27 +1403,27 @@ class ValidatesNumericalityTest &lt; ActiveRecord::TestCase
     Topic.validates_numericality_of :approved
 
     invalid!(NIL + BLANK + JUNK)
-    valid!(FLOATS + INTEGERS + BIGDECIMAL)
+    valid!(FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
   end
 
   def test_validates_numericality_of_with_nil_allowed
     Topic.validates_numericality_of :approved, :allow_nil =&gt; true
 
     invalid!(BLANK + JUNK)
-    valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL)
+    valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
   end
 
   def test_validates_numericality_of_with_integer_only
     Topic.validates_numericality_of :approved, :only_integer =&gt; true
 
-    invalid!(NIL + BLANK + JUNK + FLOATS + BIGDECIMAL)
+    invalid!(NIL + BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY)
     valid!(INTEGERS)
   end
 
   def test_validates_numericality_of_with_integer_only_and_nil_allowed
     Topic.validates_numericality_of :approved, :only_integer =&gt; true, :allow_nil =&gt; true
 
-    invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL)
+    invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY)
     valid!(NIL + INTEGERS)
   end
 
@@ -1443,7 +1444,7 @@ class ValidatesNumericalityTest &lt; ActiveRecord::TestCase
   def test_validates_numericality_with_equal_to
     Topic.validates_numericality_of :approved, :equal_to =&gt; 10
 
-    invalid!([-10, 11], 'must be equal to 10')
+    invalid!([-10, 11] + INFINITY, 'must be equal to 10')
     valid!([10])
   end
 </diff>
      <filename>activerecord/test/cases/validations_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b32790c558435a3cb454a1221fb520264d3d42c2</id>
    </parent>
  </parents>
  <author>
    <name>Chris Cherry</name>
    <email>ctcherry@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/d12660022525b9b1e25b92cd4639e32c8608f729</url>
  <id>d12660022525b9b1e25b92cd4639e32c8608f729</id>
  <committed-date>2008-07-15T15:54:19-07:00</committed-date>
  <authored-date>2008-06-05T23:26:35-07:00</authored-date>
  <message>Allow Infinity (1.0/0.0) to pass validates_numericality_of. [#354 state:resolved]

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>b3f9e20cd359ed4c9de34397732dbddd829a6483</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
