From f2cdc31786eb9942077fc1093b7bd771b6e3aeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 27 Apr 2020 19:20:58 +0200 Subject: [PATCH] Use ActiveRecord::Relation#count with a block This method used to ignore the block but in Rails 5.1 it uses Enumerable#count. See https://github.com/rails/rails/pull/24203/commits/58772397 --- app/controllers/valuation/budget_investments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 9a05f3cc8..e9cd4f21e 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -87,7 +87,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController filters << { name: heading.name, id: heading.id, - count: investments.select { |i| i.heading_id == heading.id }.size + count: investments.count { |i| i.heading_id == heading.id } } end end