From 7e02d9dd90947a72bbe101a183be0db1af267b6c Mon Sep 17 00:00:00 2001 From: Thomas Mooney Date: Tue, 22 Nov 2022 12:55:37 -0600 Subject: [PATCH] Different things get passed here; only some can be permit!ted. Fixing one case broke another; this way we can handle both hashes and more persnickety types! --- app/presenters/model_type_chart.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/presenters/model_type_chart.rb b/app/presenters/model_type_chart.rb index afb8d2f..f772e0b 100644 --- a/app/presenters/model_type_chart.rb +++ b/app/presenters/model_type_chart.rb @@ -4,6 +4,11 @@ class ModelTypeChart < DoughnutChart def initialize(data_items, base_query_params, view_context) @view_context = view_context @base_query_params = base_query_params + + if @base_query_params.respond_to?(:permit) + @base_query_params.permit! + end + super('Model Type', get_chart_items(data_items)) end @@ -13,7 +18,7 @@ def get_chart_items(data_items) ChartItem.new( type, models.count, @@color_list[index] || '#666666', - model_overview_path(@base_query_params.permit!.merge({subclass_name: type})) + model_overview_path(@base_query_params.merge({subclass_name: type})) ) end end