docs: add money-unirate-api bank backend to config examples - #783
docs: add money-unirate-api bank backend to config examples#783rob-browncc wants to merge 1 commit into
Conversation
Add Money::Bank::UniRate from the money-unirate-api gem as an alternative bank backend example alongside EuCentralBank in both the README configuration section and the initializer template. Also list available third-party bank implementations in the default_bank configuration parameter docs.
| # config.default_bank = EuCentralBank.new | ||
| # | ||
| # Other bank implementations: | ||
| # config.default_bank = Money::Bank::UniRate.new # https://github.com/UniRate-API/money-unirate-api |
There was a problem hiding this comment.
I’d rather not add it here to avoid having to maintain a list of all bank implementations.
| # config.default_bank = EuCentralBank.new | ||
| # | ||
| # Other bank implementations: | ||
| # config.default_bank = Money::Bank::UniRate.new # https://github.com/UniRate-API/money-unirate-api |
|
Hello, @rob-browncc! 👋🏻
|
| Third-party banks include | ||
| [eu_central_bank](https://github.com/RubyMoney/eu_central_bank), | ||
| [google_currency](https://github.com/RubyMoney/google_currency), and | ||
| [money-unirate-api](https://github.com/UniRate-API/money-unirate-api). |
There was a problem hiding this comment.
Actually, I just noticed something and I think it would be better if this addition is done in the money repo instead. The money gem is the one that implements default_bank and lists all implementations: https://github.com/RubyMoney/money/blob/main/README.md#implementations
I see that we're listing some unmaintained implementations that aren't compatible with money 7.x. That said, since you've added a brand new gem, I think it's worth having it be compatible with the latest version!
|
Makes total sense — I'll keep the listing in the money repo (that PR just landed, thanks!). On money 7.x compat: great call, I've updated the gem's constraint from |
Summary
Adds
money-unirate-apias a documented bank backend option in two places:Money::Bank::UniRate.newas an alternative toEuCentralBank.newlib/generators/templates/money.rb): same addition, sorails generate money_rails:initializershows users both optionseu_central_bank,google_currency,money-unirate-api) under thedefault_bankbulletNo code changes — docs only.
Context
money-unirate-apiis aMoney::Bank::VariableExchangesubclass that fetches live exchange rates from the UniRate API. Published on RubyGems; zero runtime deps beyondmoney(>= 6.13, < 7); 22 RSpec tests; CI matrix Ruby 3.0-3.4.Disclosure: I maintain the UniRate API and the
money-unirate-apigem.