Check `service.discussion_to_resolve_id` to decide content of flash

That way the check is the same in the service & the controller
This commit is contained in:
Bob Van Landuyt 2017-03-10 13:36:50 +01:00
parent 4224124ddf
commit 9541bad264
1 changed files with 1 additions and 1 deletions

View File

@ -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."