-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change RubyMoney bank to currencylayer
- Loading branch information
1 parent
5b00470
commit cca9d8e
Showing
7 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'money/bank/currencylayer_bank' | ||
|
||
Money.locale_backend = :i18n | ||
|
||
eu_bank = EuCentralBank.new | ||
Money.default_bank = eu_bank | ||
mclb = Money::Bank::CurrencylayerBank.new | ||
mclb.access_key = ENV.fetch("CURRENCY_LAYER_API_KEY", "") | ||
mclb.currencylayer = true | ||
mclb.ttl_in_seconds = 86_400 | ||
mclb.cache = 'rails_money_cache.txt' # To be replaced with proper cache path. | ||
mclb.update_rates | ||
|
||
Money.default_bank = mclb | ||
Money.default_currency = Money::Currency.new("USD") | ||
Money.rounding_mode = BigDecimal::ROUND_HALF_UP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters