<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,46 +1,16 @@
-== Money class
+== Money
 
-This money class is based on the example from the ActiveRecord doc:
-http://api.rubyonrails.org/classes/ActiveRecord/Aggregations/ClassMethods.html
-
-Its in production use at http://www.snowdevil.ca and I haven't found any major issues
-so far. 
-The main reason to open source it is because It might be useful to other people and 
-I hope i'll get some feedback on how to improve the class. 
-
-I bundled the exporter with the money class since some tests depend on it and I figured
-that most applications which need to deal with Money also need to deal with proper 
-exporting. 
+This library makes it easier to deal with Money values, storing them as integers to avoid floating-point math errors.
 
 == Download
 
 Preferred method of installation is gem: 
 
-  gem install --source http://dist.leetsoft.com money 
+  gem install --source http://gems.github.com collectiveidea-money 
 
-Alternatively you can get the library packed
+You can find the source at:
   
-  http://dist.leetsoft.com/pkg/
-
-== Usage
-
-Use the compose_of helper to let active record deal with embedding the money
-object in your models. The following example requires a cents and a currency field.
-
-  class ProductUnit &lt; ActiveRecord::Base
-    belongs_to :product
-    composed_of :price, :class_name =&gt; &quot;Money&quot;, :mapping =&gt; [%w(cents cents) %(currency currency)]
-
-    private        
-      validate :cents_not_zero
-    
-      def cents_not_zero
-        errors.add(&quot;cents&quot;, &quot;cannot be zero or less&quot;) unless cents &gt; 0
-      end
-    
-      validates_presence_of :sku, :currency
-      validates_uniqueness_of :sku        
-  end
+  http://github.com/collectiveidea/money
 
 == Rails
 
@@ -48,6 +18,7 @@ There is a rails extension that makes it easier to store money values in the dat
 
   class Product &lt; ActiveRecord::Base
     money :price
+    validates_numericality_of :price_in_cents, :greater_than =&gt; 0
   end
 
 This assumes that there is a price_in_cents (integer) column in the database, which can
@@ -55,17 +26,27 @@ be changed by passing the :cents option.  You can also specify the :currency opt
 save the currency to a field in the database.
 
   class Room &lt; ActiveRecord::Base
-    money :rate, :cents =&gt; :rate_in_cents, :currency =&gt; :rate_currency
-    money :discount, :cents =&gt; :discount_in_cents
+    money :rate, :cents =&gt; :rate_cents, :currency =&gt; :rate_currency
+    money :discount, :cents =&gt; :discount_cents
   end
 
-You can pass a String, Fixnum, or Float as a parameter to the setter, and it will call 
-#to_money to convert it to a Money object.  This makes it convenient for using money
-fields in forms.
+You can set the attribute to a String, Fixnum, or Float and it will call #to_money to
+convert it to a Money object.  This makes it convenient for using money fields in forms.
 
   r = Room.new :rate =&gt; &quot;100.00&quot;
   r.rate  # returns &lt;Money:0x249ef9c @currency=&quot;USD&quot;, @cents=10000&gt;
 
+By default, money values will be stored with a precision of 2 (cents). If you need to store different precisions, such as to the nearest tenth of a cent, you can specify the +:precision+ option:
+
+  class Room &lt; ActiveRecord::Base
+    money :rate, :precision =&gt; 3
+  end
+
+  r = Room.new :rate =&gt; &quot;100&quot;
+  r.rate.format  # returns $100.000
+  r.rate = &quot;100.995&quot;
+  r.rate.format  # returns $100.995
+
 To use the Rails functionality, install money as a plugin, or require 'money/rails'.
 This version is compatible with Rails 2.2.  For compatibility with previous versions of
 Rails, check out the rails-2.1 branch.</diff>
      <filename>README</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6c11afd96467eb9bc109d897ac522d1fb5fe69f4</id>
    </parent>
  </parents>
  <author>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </author>
  <url>http://github.com/collectiveidea/money/commit/8ecb768d1bfd183aec37b5be2704453a1e300d9f</url>
  <id>8ecb768d1bfd183aec37b5be2704453a1e300d9f</id>
  <committed-date>2009-01-21T16:19:43-08:00</committed-date>
  <authored-date>2009-01-21T16:19:43-08:00</authored-date>
  <message>Update the README</message>
  <tree>1fee601043633fd1bb0838bfbd0b6155d67e677c</tree>
  <committer>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </committer>
</commit>
