A handler for storing money in the database as integers (as cents), but dealing with them as Money Objects.
Create your tables with fields named FIELDNAME_in_cents and you will be able to access them as FIELDNAME. ActiveRecord will return Money objects instead of Fixnums.
add_column :products, :price_in_cents, :integer
product = Product.find_first
product.price = 100.00
product.price >> #<Money @cents=10000>
Money objects deal with money-math properly, and convert themselves to strings nicely.
|Created||14 March 2007|