]> source.dussan.org Git - redmine.git/commitdiff
code layout clean up IssuesController#update
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 22 Nov 2019 04:24:21 +0000 (04:24 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 22 Nov 2019 04:24:21 +0000 (04:24 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19146 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index f5103a821d7959f9059047c64eb3f68168d18f88..9f993199a579b93a3859ada7f9689d09695c15f4 100644 (file)
@@ -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