I was working on a project, then I've found a case when a == b is true but b == a is false.
Minimum code that I could find the error:
require 'hamster'
require 'bigdecimal'
a = Hamster.from({
items: [{
amount: 0.0,
quantity: 1
}]
})
b = Hamster.from({
items: [{
amount: BigDecimal('0.0'),
quantity: 1
}]
})
a == b
# => false
b == a
# => true
I was working on a project, then I've found a case when
a == bis true butb == ais false.Minimum code that I could find the error: