| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
costs_in_journey_patterns feature is not present. Refs #6102
|
|
|
|
Fix bad interpolation key in i18n file. Refs #6189
|
|
Add label in JourneyPattern Editor header. Refs #6102
|
|
Configurable extra headers on VJs editor. Refs #6143
|
|
|
|
VehicleJourneysController. Refs #6143
|
|
|
|
Refs #5113. Refs #5126. Update LineReferential icon
|
|
We say `TomTom` is disabled when no API key is present. If this is the
case, the `after_save` callback that uses it shouldn't be executed.
I had to change my `API_KEY` constant to an instance variable to be able
to change it for testing.
Refs #6095
|
|
Refs 6106 & 6107. Binds LineReferentials and StopAreaReferentials to Workgroups
|
|
|
|
Fix VehicleJourney#with_ordered_stop_area_ids scope. Refs #6006
|
|
Enforce stop points positions in merged Referential. Refs #6040
|
|
Enable stop area states. Refs #6033
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Refs #6028 small changes in model attribute for CC
|
|
|
|
|
|
|
|
|
|
|
|
Johan suggested simplifying this method by changing the `slice` call:
http://api.rubyonrails.org/classes/Hash.html#method-i-slice-21
I had modified this to fix the whitespace while working on the `WayCost`
calculation function for `Chouette::Route`s, so don't really have a
brain cache hit on this code, but the change makes sense and seems to
work.
Refs #6095
|
|
Explain why we need to skip and un-skip the callback.
Refs #6095
|
|
Since this method was run on `after_save` and in it
`RouteWayCostCalculator` calls `#update` on the given route, it caused
an infinite recursive call to the worker. To prevent this, wrap the
`#calculate!` call in methods that unset and reset the callback.
Refs #6095
|
|
Just running `Chouette::Route.find(id)` doesn't give us anything if we
don't have a `Referential` selected. In order to properly get the
correct route, pass the referential ID to the worker and switch to that
referential before trying to select the route.
Refs #6095
|
|
Not efficient to send a request to the TomTom API every time we save a
Route, but I'm banking on developing a cache system soon to avoid having
to make the requests, so hopefully that will stop this from making
expensive remote calls all the time.
Refs #6095
|
|
This method wasn't indented to the same level as the rest of the file.
Refs #6095
|
|
This new method will launch a worker that takes the route's `StopArea`s,
converts them to `WayCost`s, sends them to the TomTom API to calculate
distance and time costs, and saves those costs to the route's `costs`
field.
Refs #6095
|
|
Refs #6095
|
|
This allows us to store `WayCost`s for a route so we can use those
values as pre-filled defaults for a `JourneyPattern`'s costs.
Refs #6095
|
|
A JSON serialiser for a collection of `WayCost`s. This will be used to
store `WayCost`s for a `Chouette::Route` in the `Route#costs` JSON
field.
Refs #6095
|
|
A new class that converts a list of `StopArea`s to `WayCost`s. This will
be called from `Chouette::Route` to get `WayCost`s from its stops, which
will then be JSON serialised and stored in `Route#costs`.
Update `WayCost`:
* Remove comment about calculating the ID automatically. It actually
needs to be the same as the `JourneyPattern#cost` ID (`key`), which is
a string with the IDs of the departure and arrival stops.
* Make `#==` check that `id`s are the same, which necessitates making
`id` a reader.
Refs #6095
|
|
Extract some code from `#batch` to allow us to test the part that takes
distance and time values from the response JSON and put fill them into
`WayCost`s.
In order for the test to work, had to add an `#==` method to `WayCost`
and make `distance` and `time` accessors.
The JSON file fixture is a copy of a response from the TomTom `/batch`
API. The file is pretty big. I'm not sure if maybe I should condense it
for the sake of test performance.
Refs #6095
|
|
Rename to `#convert_way_costs` since this method now lives inside the
`TomTom::Batch` class, so that part of the name became redundant.
Refs #6095
|
|
This change enables us to call `TomTom.batch(...)` instead of
`TomTom.new.batch(...)` a couple commits ago. This is nice because the
initialisation was kind of unnecessary for users of the class.
Refs #6095
|