diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-23 10:01:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-23 10:01:16 +0000 |
commit | 77626ef6fbf2df028ccf01f6a72e459bfc70e2ab (patch) | |
tree | 226c3c315e1f3d3162dfac14535821156c703532 /app/controllers/issues_controller.rb | |
parent | d086683b17665719aa352074288b90ba954e6db0 (diff) | |
download | redmine-77626ef6fbf2df028ccf01f6a72e459bfc70e2ab.tar.gz redmine-77626ef6fbf2df028ccf01f6a72e459bfc70e2ab.zip |
Adds support for adding attachments to issues through the REST API (#8171).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8928 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r-- | app/controllers/issues_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7adad0008..e8ff416b7 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -149,7 +149,7 @@ class IssuesController < ApplicationController def create call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue }) - @issue.save_attachments(params[:attachments]) + @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) if @issue.save call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) respond_to do |format| @@ -181,7 +181,7 @@ class IssuesController < ApplicationController def update return unless update_issue_from_params - @issue.save_attachments(params[:attachments]) + @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) saved = false begin saved = @issue.save_issue_with_child_records(params, @time_entry) |