I find myself doing the same things over and over again just to make one small modification to standard model output. I have a series of tables that I store information about products, etc. and all of which store prices. The prices are stored in US dollars but the output depends on the currency the user wants which is stored in a their session.
Examples:
Product Detail Blah Price
Hammer Red More 5.00
Nail Blue Stuff 3.99
Is there a simple robust way to modify the output so that when i call:
Product.all
I could attach something like
Product.all.currency('EUR')
Product.find(22).currency('EUR')
Product.find(:all, :conditions => 'etc etc').currency('EUR')
or
Product.all.currency(0.69)
and simply multiply all of the items in the Price column? Could named_scope do this?