From 604c67e96509d79a526a6a815fb83479dd9e8c2b Mon Sep 17 00:00:00 2001 From: Peter Fortuna Date: Tue, 22 Sep 2026 13:10:13 -0400 Subject: [PATCH 1/3] Correct eql? method warning This warning assumes the currencies are not equal. It would be best to make that explicit. --- lib/money/money/arithmetic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/money/money/arithmetic.rb b/lib/money/money/arithmetic.rb index 06a500521e..ad28404af3 100644 --- a/lib/money/money/arithmetic.rb +++ b/lib/money/money/arithmetic.rb @@ -39,7 +39,7 @@ def -@ # @see Money.strict_eql_compare def eql?(other) if other.is_a?(Money) - if !Money.strict_eql_compare && fractional == 0 && other.fractional == 0 + if !Money.strict_eql_compare && fractional == 0 && other.fractional == 0 && currency != other.currecy warn "[DEPRECATION] Comparing 0 #{currency} with 0 " \ "#{other.currency} using `#eql?` will return false in " \ "future versions of Money. Opt-in to the new behavior by " \ From dd836f53e8ecbe2df3e3730c1757322d260bbcc1 Mon Sep 17 00:00:00 2001 From: Peter Fortuna Date: Tue, 22 Sep 2026 13:20:27 -0400 Subject: [PATCH 2/3] typo --- lib/money/money/arithmetic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/money/money/arithmetic.rb b/lib/money/money/arithmetic.rb index ad28404af3..9161dce21c 100644 --- a/lib/money/money/arithmetic.rb +++ b/lib/money/money/arithmetic.rb @@ -39,7 +39,7 @@ def -@ # @see Money.strict_eql_compare def eql?(other) if other.is_a?(Money) - if !Money.strict_eql_compare && fractional == 0 && other.fractional == 0 && currency != other.currecy + if !Money.strict_eql_compare && fractional == 0 && other.fractional == 0 && currency != other.currency warn "[DEPRECATION] Comparing 0 #{currency} with 0 " \ "#{other.currency} using `#eql?` will return false in " \ "future versions of Money. Opt-in to the new behavior by " \ From 2ec53b5a86137895de051d2a050d48ce8aeea7f6 Mon Sep 17 00:00:00 2001 From: Peter Fortuna Date: Wed, 23 Sep 2026 11:56:36 -0400 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f9cba998a..000bc8422a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix `Money::Currency.reset!` keeping the cached key set, so a currency registered before the reset was still accepted by `Money::Currency.new` and raised `NoMethodError` instead of `UnknownCurrency` - Fix `Money::Bank::VariableExchange#import_rates` parsing `:json` with `JSON.load`, which instantiates any class named by a `json_class` key; it now uses `JSON.parse` +- Fix deprecation warning for eql? ## 7.1.1