brewster / elastictastic

Object-document mapper and lightweight API adapter for ElasticSearch
MIT License
88 stars 13 forks source link

Fix object comparison #26

Closed mrcasals closed 11 years ago

mrcasals commented 11 years ago

Elastictastic was not able to compare two objects that were apparently similar:

expected 
    [#<Product id: "1", index: "my_index", name: "Book", ...>]
to include
    #<Product id: "1", index: "my_index", name: "Book", ...>

Also, prevents this bug to occur:

expected 
    [#<Product id: "1", index: "my_index", name: "Book", ...>]
not to include
    #<User id: "1", index: "my_index", name: "John Dove", ...>

I also added two tests to check those behaviours.

Thanks for your work! :)

outoftime commented 11 years ago

Ouch, great catch. Thanks!