app/queries/decidim/proposals/metrics/proposals_metric_manage.rb in decidim-proposals-0.18.1 vs app/queries/decidim/proposals/metrics/proposals_metric_manage.rb in decidim-proposals-0.19.0
- old
+ new
@@ -12,9 +12,10 @@
return @registry if @registry
@registry = []
cumulative.each do |key, cumulative_value|
next if cumulative_value.zero?
+
quantity_value = quantity[key] || 0
category_id, space_type, space_id = key
record = Decidim::Metric.find_or_initialize_by(day: @day.to_s, metric_type: @metric_name,
organization: @organization, decidim_category_id: category_id,
participatory_space_type: space_type, participatory_space_id: space_id)