Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Accept money from forms and store as integers with ActiveRecord

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 has_money.gemspec
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

In your `Gemfile`:

gem 'has_money'

As a plugin:

script/plugin install git://github.com/samvincent/has_money.git
Something went wrong with that request. Please try again.