Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Fix `Money::Currency.register` exception when table is not initialized.

## 7.0.1

- Re-publishing gem to fix file permissions https://github.com/RubyMoney/money/issues/1170
Expand Down
4 changes: 2 additions & 2 deletions lib/money/currency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def stringified_keys
def register(curr)
key = curr.fetch(:iso_code).downcase.to_sym
@@mutex.synchronize { _instances.delete(key.to_s) }
@table[key] = curr
table[key] = curr
@stringified_keys = nil
clear_iso_numeric_cache
end
Expand All @@ -184,7 +184,7 @@ def register(curr)
# @param curr [Hash] See {register} method for hash structure
def inherit(parent_iso_code, curr)
parent_iso_code = parent_iso_code.downcase.to_sym
curr = @table.fetch(parent_iso_code, {}).merge(curr)
curr = table.fetch(parent_iso_code, {}).merge(curr)
register(curr)
end

Expand Down