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 diff --git a/lib/money/money/arithmetic.rb b/lib/money/money/arithmetic.rb index 06a500521e..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 + 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 " \