RubyMoney/money-rails — pull request #23 by tfwright (2012-07-05 17:39:03+00:00)
Title: Refactor instance currency implementation

This change takes advantage of the removal of the limitations imposed by `composed_of` to re-implement instance currency so that it is

1. Agnostic about implementation (you can use a column on the table, or just a method)
2. Compatible with field currency (so that if field currency is set but the instance currency returns a non-nil value, it overrides it)

This should be backwards compatible, it just won't error in the case where you try to use both instance and field currency at the same time.

I had to remove the use of read/write attribute to make this work, but they were not being properly used anyway (I think that actually they should really only be used to override AR attr accessor methods, not to invoke them).

It's also less code :)