From bee8063f468292140762cffac5dbf147f81e897f Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 22 Nov 2019 04:24:21 +0000 Subject: [PATCH] code layout clean up IssuesController#update git-svn-id: http://svn.redmine.org/redmine/trunk@19146 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index f5103a821..9f993199a 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -166,7 +166,8 @@ class IssuesController < ApplicationController def update return unless update_issue_from_params - @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) + @issue.save_attachments(params[:attachments] || + (params[:issue] && params[:issue][:uploads])) saved = false begin saved = save_issue_with_child_records @@ -174,16 +175,23 @@ class IssuesController < ApplicationController @conflict = true if params[:last_journal_id] @conflict_journals = @issue.journals_after(params[:last_journal_id]).to_a - @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + unless User.current.allowed_to?(:view_private_notes, @issue.project) + @conflict_journals.reject!(&:private_notes?) + end end end if saved render_attachment_warning_if_needed(@issue) - flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? || params[:no_flash] - + unless @issue.current_journal.new_record? || params[:no_flash] + flash[:notice] = l(:notice_successful_update) + end respond_to do |format| - format.html { redirect_back_or_default issue_path(@issue, previous_and_next_issue_ids_params) } + format.html { + redirect_back_or_default( + issue_path(@issue, previous_and_next_issue_ids_params) + ) + } format.api { render_api_ok } end else -- 2.39.5