From 90a6b81087ca9352709c782c783ef74953b1ef03 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Wed, 10 Apr 2019 10:02:34 +0200 Subject: [PATCH] call method differently. #229 --- app/controllers/providers_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/providers_controller.rb b/app/controllers/providers_controller.rb index 531755ba2..2bdcc5fba 100644 --- a/app/controllers/providers_controller.rb +++ b/app/controllers/providers_controller.rb @@ -143,10 +143,10 @@ def totals # don't delete, but set deleted_at timestamp - # a provider with clients or prefixes can't be deleted + # a provider with active clients or with prefixes can't be deleted def destroy logger = Logger.new(STDOUT) - if @provider.active_client_count > 0 + if active_client_count(provider_id: @provider.symbol) > 0 message = "Can't delete provider that has active clients." status = 400 logger.warn message