Repository navigation
Move withdrawn ISO 4217 codes out of currency_iso.json - #1239
Open
yu2971512385-ui wants to merge 1 commit into
Open
yu2971512385-ui wants to merge 1 commit into
yu2971512385-ui wants to merge 1 commit into
Conversation
ANG, BGN, BYR, CUC, SKK, SLL, STD and ZMK were withdrawn from ISO 4217 between 2009 and this January, and the repository already keeps a file for retired codes. BYR also carried a priority of 50, which put a currency withdrawn in 2017 seventh in Money::Currency.all, ahead of every currency still in use; the other retired entries all sit at 100. The loader merges the three files, so every code resolves exactly as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

config/currency_iso.jsonholds eight codes that ISO 4217 has withdrawn, whileconfig/currency_backwards_compatible.jsonexists for exactly that. Checked against ISO 4217 list three (the historical list, published 2026-01-01):BGN is this January's — Bulgaria adopted the euro.
The part that is visible
BYR also carries
"priority": 50. Only seven currencies in the file have a priority below 100, and the other six are the majors, so a currency withdrawn in 2017 comes seventh inMoney::Currency.all, ahead of every currency still in use:Anything that builds a currency picker from
.allhas been offering the pre-2016 Belarusian ruble in seventh place. Every entry already incurrency_backwards_compatible.jsonsits at 100, so this drops BYR to match them.Nothing stops resolving
Loader.load_currenciesmerges all three files, so moving an entry between them changes no lookup. Verified on the merged table:Money::Currency.new(:skk),.find("ANG")andfind_by_iso_numericall behave as before. The one thing that does shift is the iteration order of the merged hash, and with it the order of equal-priority entries in.all— but.allusessort_by(&:priority), which is not a stable sort, so that order was never defined to begin with.Testing
Added one case to the existing
.allblock, which fails onmasterand passes here:CHANGELOG and AUTHORS updated per CONTRIBUTING.
I left
currency_iso.jsonalone otherwise. It also lacks VED and XAD, which are current in list one, but it deliberately omits the funds codes (BOV, CHE, CHW, COU, MXV, USN, UYI, UYW) and the units of account XSU and XUA, so where that boundary sits is your call rather than a bug.Disclosure: written with AI assistance (Claude). The withdrawal dates come from ISO 4217 list three via SIX Group, and every figure above is real output from this branch.
🤖 Generated with Claude Code