money-rails
money-rails copied to clipboard
Add Money.with_bank for Dynamic Currency Stores
This PR introduces the Money.with_bank method, allowing developers to assign different currency stores (banks) dynamically within a scoped block. This is particularly useful for loading custom exchange rates per user session.
Key Changes
- Implemented Money.with_bank(bank_instance), enabling temporary overrides of the default bank.
- Ensures thread safety by restoring the original bank after execution.
- Added documentation and an example demonstrating its usage in a Rails controller with around_action.