We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A recent graphql gem bump PR in Billing which introduced additional checks to ensured a field isn't defined more than once revealed an issue with Money::Currency.currencies as there is a pair of currency entries with the same ISO code.
Money::Currency.currencies
The error is raised on https://github.com/Shopify/billing/blob/dependabot/bundler/graphql-1.12.4/app/graphql/types/currency_code.rb#L8, when the iso_code is used to create the fields. There are 2 that are the same with GHS, which results in the error ArgumentError: GHS is already defined for CurrencyCode, please remove one of the definitions.:
iso_code
GHS
ArgumentError: GHS is already defined for CurrencyCode, please remove one of the definitions.
[19] pry(main)> (::Money::Currency.currencies.values.map{|x| x["iso_code"]}).count => 190 [20] pry(main)> (::Money::Currency.currencies.values.map{|x| x["iso_code"]}).uniq.count => 189
{ "priority":100, "iso_code":"GHS", "name":"Ghanaian Cedi", "symbol":"₵", "disambiguate_symbol":"GH₵", "alternate_symbols":[ "GH₵" ], "subunit":"Pesewa", "subunit_to_unit":100, "symbol_first":true, "html_entity":"₵", "decimal_mark":".", "thousands_separator":",", "iso_numeric":"288", "smallest_denomination":1 }
{ "priority":100, "iso_code":"GHS", "name":"Ghanaian Cedi", "symbol":"₵", "alternate_symbols":[ "GH¢", "GH₵" ], "subunit":"Pesewa", "subunit_to_unit":100, "symbol_first":true, "html_entity":"₵", "decimal_mark":".", "thousands_separator":",", "iso_numeric":"936", "smallest_denomination":1 }
Based on https://en.wikipedia.org/wiki/ISO_4217#Numeric_codes, it looks like the "iso_numeric":"288" one is historic while "iso_numeric":"936" is current.
"iso_numeric":"288"
"iso_numeric":"936"
I'm unsure how long this has been going on. The relevant ymls haven't been recently changed and they seem to look correct: 288, 936.
Is this indeed an issue? Should we make sure that Money::Currency.currencies doesn't return two currency entries for GHS?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A recent graphql gem bump PR in Billing which introduced additional checks to ensured a field isn't defined more than once revealed an issue with
Money::Currency.currencies
as there is a pair of currency entries with the same ISO code.The error is raised on https://github.com/Shopify/billing/blob/dependabot/bundler/graphql-1.12.4/app/graphql/types/currency_code.rb#L8, when the
iso_code
is used to create the fields. There are 2 that are the same withGHS
, which results in the errorArgumentError: GHS is already defined for CurrencyCode, please remove one of the definitions.
:Based on https://en.wikipedia.org/wiki/ISO_4217#Numeric_codes, it looks like the
"iso_numeric":"288"
one is historic while"iso_numeric":"936"
is current.I'm unsure how long this has been going on. The relevant ymls haven't been recently changed and they seem to look correct: 288, 936.
Is this indeed an issue? Should we make sure that
Money::Currency.currencies
doesn't return two currency entries forGHS
?The text was updated successfully, but these errors were encountered: