Rails Money plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://svn.nullcreations.net/plugins/rails_money
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 >> #
Creating a Money can be done from a Fixnum (dollars) or a Float (dollars.cents). To create a money object from just cents, do Money.create_from_cents(100)
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (2 older versions) | Last edited by: jerrett, 10 months ago

