| Age | Commit message (Collapse) | Author | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Refs #3398
 | 
 | 
 | 
 | 
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
 | 
 | 
Refs #3372
 | 
 | 
This reverts commit 012a2e5cdcf62d60325a951929850b4e08b24530.
Now that we've fixed the departure time filter on
VehicleJourneysController#index
(7bf94bc6e6ce6558252252e68419e89a23213573) and re-enabled the supporting
JavaScript (36ebc58343bc82c08672f019b1102c3f49e244fb), this temporary
test fix can be reverted.
 | 
 | 
This section is a little dense. Comment what it is to make it more
obvious.
Refs #3370
 | 
 | 
This method is superseded by
`VehicleJourney.where_departure_time_between`.
Refs #3370
 | 
 | 
Handle temporary fixes from 972500267f28f233d5670277c02d43fae5ad8e7b and
1f6fb9c73206f3984d2f942d5d16fb9c094b2164. Restore the JavaScript because
that should function the same way now.
Remove the Ransack call as we've moved this departure time filter
outside of Ransack and into our own custom method in order to eliminate
a duplicated "JOIN" call on "vehicle_journey_at_stops" collision between
the `.with_stops` query and Ransack. The new filter lives in
`VehicleJourney.where_departure_time_between`.
Refs #3370
 | 
 | 
There's a `params[:q][:vehicle_journey_without_departure_time]`
parameter coming in from the frontend that's supposed to allow it to
decide whether or not to include vehicle journeys that have nil stops.
Allow this parameter to function for the
`VehicleJourney.where_departure_time_between` method by conditionally
checking an input parameter to determine whether to add the "OR"
condition onto the "WHERE" filter.
Refs #3370
 | 
 | 
Add our custom departure time range filter to the query. We pass the
times sent from the frontend into the query in order to get the correct
vehicle journeys back.
Copied the `if params[:q]` check from `#ransack_periode_filter`, but
added an additional condition on the existence of
`:vehicle_journey_at_stops_departure_time_lteq` instead of blatantly
assuming it's there just because its `..._gteq` counterpart is.
Adding the filter necessitated some modifications to the
`VehicleJourneys.departure_time_between` method. We needed to remove the
`SELECT DISTINCT` and join parts of the query, reducing it to a simple
"where" condition.
These removals were due to the nature of the combination of this method
with `VehicleJourneys.with_stops`. The `.with_stops` method already does
a join on `vehicle_journey_at_stops`, and there's already a `SELECT
DISTINCT` applied to the controller's query.
Made the decision to limit this method's use to this specific use-case,
and thus expect DISTINCT and the necessary join to already be defined on
the `ActiveRecord` query object. We modify the test to implement this
requirement.
Finally, rename `.departure_time_between` to
`.where_departure_time_between` to further indicate that this is a
simple `where` condition, without the required extras.
Refs #3370
 | 
 | 
A new class method that allows a vehicle journey collection to be
filtered by a departure time range.
This will eventually replace the
`VehicleJourneysController#ransack_periode_filter` method, moving the
filter out of Ransack and into this custom code.
The reason we're doing this is because when trying to filter, Ransack
inserts a duplicate `LEFT OUTER JOIN` on "vehicle_journey_at_stops" from
`VehicleJourneysController#collection`.
(`route.vehicle_journeys.with_stops` + the filter causes the duplicate
column error.)
For the moment, this method lives on its own. It needs more work to be
integrated such that we can chain it with the `.with_stops` method. In
particular, we still have the duplicate join problem.
Refs #3370
 | 
 | 
Instead of hard-coding the departure and arrival times of the associated
`VehicleJourneyAtStop`s, put the times in transient attributes so that
they can be changed for tests that need different stop times.
Refs #3370
 | 
 | 
Match the style from the `joins` call above, quoting the table and
column name, for consistency.
 | 
 | 
 | 
 | 
 | 
 | 
Refs #3356
 | 
 | 
 | 
 | 
Refs #3303
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Refs #3358
 | 
 | 
Refs #3109
 | 
 | 
 | 
 | 
Refs #3358
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
Signed-off-by: Jean Pual Lescouzères <jpl-laboulette@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
 | 
 | 
Refs #3353
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Ref #3347
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Refs #3329
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
 |