<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -84,8 +84,8 @@ module DataMapper
           opts[:integer_only] = true
           validates_is_number property.name, opts
         elsif BigDecimal == property.type || Float == property.type
-          opts[:precision] = property.precision
-          opts[:scale]     = property.scale
+          opts[:precision] = property.precision if property.precision &gt; 0
+          opts[:scale]     = property.scale     if property.scale != 10
           validates_is_number property.name, opts
         end
       end</diff>
      <filename>dm-validations/lib/dm-validations/auto_validate.rb</filename>
    </modified>
    <modified>
      <diff>@@ -52,4 +52,30 @@ describe DataMapper::Validate::NumericValidator do
     h = Hillary.new
     h.should be_valid
   end
+
+  it &quot;should validate with autovalidate&quot; do
+
+    class RobotFish
+      include DataMapper::Resource
+      property :id,     Integer, :serial =&gt; true
+      property :scales, Integer
+      property :average_weight, Float
+    end
+
+    class PondFish
+      include DataMapper::Resource
+      property :id,     Integer, :serial =&gt; true
+      property :scales, Integer
+      property :average_weight, Float, :scale =&gt; 10, :precision =&gt; 0, :auto_validation =&gt; false
+      validates_is_number :average_weight
+    end
+
+    fish1 = PondFish.new
+    fish2 = RobotFish.new
+    fish1.scales = fish2.scales = 1
+    fish1.average_weight = fish2.average_weight = 20.22
+    fish1.valid?.should == true
+    fish2.valid?.should == true
+  end
+
 end</diff>
      <filename>dm-validations/spec/integration/numeric_validator_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>28e69c642b8a534837913e2e0b6ffb63a977348e</id>
    </parent>
  </parents>
  <author>
    <name>Alex Coles</name>
    <email>alexbcoles@mac.com</email>
  </author>
  <url>http://github.com/sam/dm-more/commit/c88cc4e939519922e2a45db629443b955204f966</url>
  <id>c88cc4e939519922e2a45db629443b955204f966</id>
  <committed-date>2008-05-22T05:32:30-07:00</committed-date>
  <authored-date>2008-05-22T05:32:30-07:00</authored-date>
  <message>Fixed issue with auto-validation

* Only pass through scale and precision to the numeric_validator
  if those values are explicitly specified in the property.
* Fixes issue #300, where a RegexpError was being
  thrown for auto-validations on Floats without a
  specified precision and scale.</message>
  <tree>c751adcdeee6de89b93e12fdaecbce5848606537</tree>
  <committer>
    <name>Alex Coles</name>
    <email>alexbcoles@mac.com</email>
  </committer>
</commit>
