Reputation: 1832
Instead of having a integer _cents field, and a _currency string field, I've created a Currency model, which has:
Examples:
Do you know how can I do to integrate this model with the money-rails gem? (I mean, for having a reference to the currency instead of saving the iso_code, and for using the exchange rate in the currency model)
Upvotes: 0
Views: 274
Reputation: 36
Have you tried using the provided initializer to change the config.amount_column
and config.currency_column
options? Changing the column_name
options in these might let you change it to a method name that returns the your currency model's attributes, and allow the gem to work its magic.
Upvotes: 1