From 622e19acff68a38361063df1abf8e98152f3d988 Mon Sep 17 00:00:00 2001 From: jpl Date: Thu, 1 Jun 2017 11:38:19 +0200 Subject: Refs #3638: changing without_tt toggle filter default behaviour --- app/controllers/vehicle_journeys_controller.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'app/controllers/vehicle_journeys_controller.rb') diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb index 6d40d495b..53008c7ce 100644 --- a/app/controllers/vehicle_journeys_controller.rb +++ b/app/controllers/vehicle_journeys_controller.rb @@ -117,10 +117,12 @@ class VehicleJourneysController < ChouetteController end def maybe_filter_out_journeys_with_time_tables(scope) - if params[:q] && - params[:q][:vehicle_journey_without_time_table] == 'false' - return scope - .without_time_tables + if params[:q] + if params[:q][:vehicle_journey_without_time_table] == 'false' + return scope.without_time_tables + end + else + return scope.without_time_tables end scope @@ -135,7 +137,7 @@ class VehicleJourneysController < ChouetteController def adapted_params params.tap do |adapted_params| - adapted_params.merge!( :route => parent) + adapted_params.merge!(:route => parent) hour_entry = "vehicle_journey_at_stops_departure_time_gt(4i)".to_sym if params[:q] && params[:q][ hour_entry] adapted_params[:q].merge! hour_entry => (params[:q][ hour_entry].to_i - utc_offset) -- cgit v1.2.3