RubyMoney/money-rails — pull request #26 by rwtnorton (2012-07-12 21:16:47+00:00)
Title: Changes to allow symbol for :with_model_currency.

There is already support for using a separate currency column to determine the currency for a monetize'd column:

class Foo < ActiveRecord::Base
monetize :bar_cents, :with_model_currency => 'bar_currency_code'
...
end

But, note that I had to use a string to specify the :with_model_currency option.

The patch to lib/money-rails/active_record/monetizable.rb allows use of a symbol if desired:

class Foo < ActiveRecord::Base
monetize :bar_cents, :with_model_currency => :bar_currency_code
...
end

Other submits are to add tests for this. Added two columns to the product model: sale_price_amount and sale_price_currency_code (where both are used for monetize'd attribute sale_price). Use of an alternate _cents column name strayed a little from the heart of the problem but better demonstrated my specific use case.