From 9541bad2647360c35916b6a402122501b5374c29 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Fri, 10 Mar 2017 13:36:50 +0100 Subject: [PATCH] Check `service.discussion_to_resolve_id` to decide content of flash That way the check is the same in the service & the controller --- app/controllers/projects/issues_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 91fe6662164..f2fee62ebd6 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -110,7 +110,7 @@ class Projects::IssuesController < Projects::ApplicationController @issue = service.execute if service.discussions_to_resolve.count(&:resolved?) > 0 - flash[:notice] = if params[:discussion_to_resolve].present? + flash[:notice] = if service.discussion_to_resolve_id "Resolved 1 discussion." else "Resolved all discussions."