Closed alextoul closed 5 years ago
This works with the slug
property for now.
E.g.:
Decathlon::Sports.find('snowboarding')
I'll improve it to be a bit smarter and query the elasticsearch index when a string is passed in.
Cool! Not documented on developers.decathlon.com then ?
@alextoul The above PR adds a method that will search the index (via ElasticSearch) for the name of the sport via a .search
method as such:
Decathlon::Sports.search('snowboarding')
Decathlon::Sports.where(name: 'Snowboarding')
Decathlon::Sports.find(71) isn't readable