Accept money from forms and store as integers with ActiveRecord
Ruby
Pull request Compare This branch is 1 commit ahead, 22 commits behind samvincent:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
has_money.gemspec
init.rb

README.rdoc

has_money

Usage

In your ActiveRecord model:

class Order < ActiveRecord::Base
  has_money :default_price
end

Defines methods :default_price_in_dollars and :default_price_in_dollars= which make life easier when building forms.

> Order.new :default_price_in_dollars => '10.00'
=> #<Order default_price: 1000>

Install

As a gem:

$ gem install has_money

As a plugin:

script/plugin install git://github.com/samvincent/has_money.git