diff options
| author | Teddy Wing | 2017-05-22 15:20:08 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-05-22 15:38:50 +0200 |
| commit | a6aae5dc43eb89ba7ebc5f794f03ce722986957a (patch) | |
| tree | 094037e79a7bee5df5c8d507c79fc55326a8e524 | |
| parent | 44712fe052e0c554c0510d4665a35c66540ffa05 (diff) | |
| download | chouette-core-a6aae5dc43eb89ba7ebc5f794f03ce722986957a.tar.bz2 | |
VehicleJourneys#index: Change "without_time_tables" logic to opposite
It turns out as described in 44712fe052e0c554c0510d4665a35c66540ffa05
that the vehicle journeys without time tables filter should only show
those vehicle journeys without time tables when the toggle is set to
"Oui".
* Rename our filter method so it makes sense for the new logic
* Use the updated `VehicleJourneys.without_time_tables` method name
* Change the query param check from "false" to "true" to enable the
filter on "Oui"
Refs #3427
| -rw-r--r-- | app/controllers/vehicle_journeys_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb index e72145c1e..71787ba78 100644 --- a/app/controllers/vehicle_journeys_controller.rb +++ b/app/controllers/vehicle_journeys_controller.rb @@ -84,7 +84,7 @@ class VehicleJourneysController < ChouetteController def collection scope = route.vehicle_journeys.with_stops scope = maybe_filter_by_departure_time(scope) - scope = maybe_filter_without_time_tables(scope) + scope = maybe_filter_out_journeys_with_time_tables(scope) @q = scope.search filtered_ransack_params @@ -110,11 +110,11 @@ class VehicleJourneysController < ChouetteController scope end - def maybe_filter_without_time_tables(scope) + def maybe_filter_out_journeys_with_time_tables(scope) if params[:q] && - params[:q][:vehicle_journey_without_time_table] == 'false' + params[:q][:vehicle_journey_without_time_table] == 'true' return scope - .exclude_journeys_without_time_tables + .without_time_tables end scope |
