Skip to content

Commit c0ecce8

Browse files
sirwolfgangsunny
andcommitted
Apply suggestions from code review
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
1 parent a6389d0 commit c0ecce8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Upcoming 7.0.0.alpha
44

55
- **Potential breaking change**: Fix USDC decimals places from 2 to 6
6+
- Allow `nil` to be used as a default_currency
67

78
## 6.19.0
89

lib/money/money.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def self.from_amount(amount, currency = default_currency, options = {})
310310
raise ArgumentError, "'amount' must be numeric" unless Numeric === amount
311311

312312
currency = Currency.wrap(currency) || Money.default_currency
313-
raise Currency::NoCurrency, 'must be provide a currency' if currency.nil?
313+
raise Currency::NoCurrency, 'must provide a currency' if currency.nil?
314314

315315
value = amount.to_d * currency.subunit_to_unit
316316
new(value, currency, options)
@@ -356,7 +356,7 @@ def initialize(obj, currency = Money.default_currency, options = {})
356356

357357
# BigDecimal can be Infinity and NaN, money of that amount does not make sense
358358
raise ArgumentError, 'must be initialized with a finite value' unless @fractional.finite?
359-
raise Currency::NoCurrency, 'must be provide a currency' if @currency.nil?
359+
raise Currency::NoCurrency, 'must provide a currency' if @currency.nil?
360360
end
361361

362362
# Assuming using a currency using dollars:

0 commit comments

Comments
 (0)