Skip to content

Equality issues #247

@mauricioszabo

Description

@mauricioszabo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions