summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-22 16:49:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-22 16:49:43 +0000
commitf50d50f7b87828b425488ec5ef28c3c34e4e8172 (patch)
tree27a103a90759c7228d7cf604ffae760153dd8920 /app/controllers/issues_controller.rb
parent80b0ee2cf8656fd71ab99a5b2f9432816b8d0253 (diff)
downloadredmine-f50d50f7b87828b425488ec5ef28c3c34e4e8172.tar.gz
redmine-f50d50f7b87828b425488ec5ef28c3c34e4e8172.zip
code layout clean up app/controllers/issues_controller.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19176 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 82f165025..a3ca3bc6a 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -599,7 +599,9 @@ class IssuesController < ApplicationController
# Saves @issue and a time_entry from the parameters
def save_issue_with_child_records
Issue.transaction do
- if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, @issue.project)
+ if params[:time_entry] &&
+ (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) &&
+ User.current.allowed_to?(:log_time, @issue.project)
time_entry = @time_entry || TimeEntry.new
time_entry.project = @issue.project
time_entry.issue = @issue
@@ -608,10 +610,19 @@ class IssuesController < ApplicationController
time_entry.safe_attributes = params[:time_entry]
@issue.time_entries << time_entry
end
-
- call_hook(:controller_issues_edit_before_save, { :params => params, :issue => @issue, :time_entry => time_entry, :journal => @issue.current_journal})
+ call_hook(
+ :controller_issues_edit_before_save,
+ {:params => params, :issue => @issue,
+ :time_entry => time_entry,
+ :journal => @issue.current_journal}
+ )
if @issue.save
- call_hook(:controller_issues_edit_after_save, { :params => params, :issue => @issue, :time_entry => time_entry, :journal => @issue.current_journal})
+ call_hook(
+ :controller_issues_edit_after_save,
+ {:params => params, :issue => @issue,
+ :time_entry => time_entry,
+ :journal => @issue.current_journal}
+ )
else
raise ActiveRecord::Rollback
end