transitland / transitland-datastore

Transitland v1 core components. Deprecated and only maintained occasionally. See Transitland v2.
https://transit.land/documentation/datastore/
MIT License
105 stars 18 forks source link

Error when querying several stops schedule with "now" or "today" #1277

Open elsa-pato opened 5 years ago

elsa-pato commented 5 years ago

Hi,

I'm running into an error when trying to use the special parameters "today" and "now" in schedule_stop_pairs, combined with a query concerning several stops.

Example of a failing query : http://transit.land/api/v1/schedule_stop_pairs?origin_onestop_id=s-spey61hqnj-th%C3%89atrelacri%C3%89e,s-spey6d99hu-canebierereformes&date=today while this works fine http://transit.land/api/v1/schedule_stop_pairs?origin_onestop_id=s-spey61hqnj-th%C3%89atrelacri%C3%89e,s-spey6d99hu-canebierereformes&date=2019-04-19

Same with "now" http://transit.land/api/v1/schedule_stop_pairs?origin_onestop_id=s-spey61hqnj-th%C3%89atrelacri%C3%89e,s-spey6d99hu-canebierereformes&origin_departure_between=now,now+1800 this works fine : http://transit.land/api/v1/schedule_stop_pairs?origin_onestop_id=s-spey61hqnj-th%C3%89atrelacri%C3%89e,s-spey6d99hu-canebierereformes&origin_departure_between=16:00:00,16:30:00

The error I get is {"message":"[NameError] uninitialized constant OnestopId::MODEL"}

I am wondering if this is related to a timezone definition issue ? As this is specified in the doc

For both of these options, a local timezone must be specified by providing one of the following parameters: origin_onestop_id, destination_onestop_id, or operator_onestop_id.

In my case both stops are located in the same timezone though. Or maybe I'm doing something wrong :nerd_face: