RubyMoney/money — pull request #359 by Nerian (2014-01-19 21:03:21+00:00)
Title: Money.default_currency=() accepts a lambda.

Hi,

This pull request modifies Money to accept a lambda when setting a default_currency.

This is useful for multithreaded environments, like a Ruby on Rails application running on Puma. I use like this:

````
MoneyRails.configure do |config|

# To set the default currency
config.default_currency = lambda { RequestStore.store[:default_currency] || :eur }
````

````
# -*- encoding : utf-8 -*-

class ApplicationController < ActionController::Base

before_filter :set_currency

def set_currency
RequestStore.store[:default_currency] = current_clinic.currency
end
end
```