From 5b6db251a8b8d4528ed161b0462a62ab0bdba458 Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 4 Apr 2019 14:54:25 +0000 Subject: Consider array params on rendering MR list on dashboard This fixes the bug, when approver filter is provided, but dashboard asks to enter any filter --- app/controllers/dashboard_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 75329b05a6f..1a97b39d3ae 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -46,7 +46,10 @@ class DashboardController < Dashboard::ApplicationController end def check_filters_presence! - @no_filters_set = finder_type.scalar_params.none? { |k| params.key?(k) } + no_scalar_filters_set = finder_type.scalar_params.none? { |k| params.key?(k) } + no_array_filters_set = finder_type.array_params.none? { |k, _| params.key?(k) } + + @no_filters_set = no_scalar_filters_set && no_array_filters_set return unless @no_filters_set -- cgit v1.2.1