summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-24 15:34:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-24 15:34:41 +0000
commit521eaa79cb56a86e83876d95fa510ca13aebfbdf (patch)
tree94e033dcd604795d60616520597a678b1fa96635 /app/controllers/issues_controller.rb
parent49900051ea2b404161dae568eeaec6f26bbe0c9d (diff)
downloadredmine-521eaa79cb56a86e83876d95fa510ca13aebfbdf.tar.gz
redmine-521eaa79cb56a86e83876d95fa510ca13aebfbdf.zip
Ability to load relations on /issues API (#7366).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6313 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index c8778b473..1bf969cd5 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -90,7 +90,9 @@ class IssuesController < ApplicationController
respond_to do |format|
format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
- format.api
+ format.api {
+ Issue.load_relations(@issues) if include_in_api_response?('relations')
+ }
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
format.csv { send_data(issues_to_csv(@issues, @project), :type => 'text/csv; header=present', :filename => 'export.csv') }
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'export.pdf') }