Closed brauliomartinezlm closed 5 years ago
I detected that Place object comparison was not working properly with == and only eql? was overwritten.
==
eql?
This causes methods things like https://github.com/Skalar/google_distance_matrix/blob/master/lib/google_distance_matrix/routes_finder.rb#L23 and https://github.com/Skalar/google_distance_matrix/blob/master/lib/google_distance_matrix/routes_finder.rb#L59 will not work properly as they are comparing Place objects with diff object_id as Array#includes? does not use eql?.
Array#includes?
I'm opening a PR with tests to better explain and attempt to fix it.
Thank you. I have merged your pull request.
I detected that Place object comparison was not working properly with
==
and onlyeql?
was overwritten.This causes methods things like https://github.com/Skalar/google_distance_matrix/blob/master/lib/google_distance_matrix/routes_finder.rb#L23 and https://github.com/Skalar/google_distance_matrix/blob/master/lib/google_distance_matrix/routes_finder.rb#L59 will not work properly as they are comparing Place objects with diff object_id as
Array#includes?
does not useeql?
.I'm opening a PR with tests to better explain and attempt to fix it.