diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-23 16:51:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-23 16:51:46 +0000 |
commit | 4714b310022d7c5da48686372a58e99d5368c9af (patch) | |
tree | 252953ddc8499709beaab85905ba8f41a29fb262 | |
parent | c29727dd39fa3fac888057c2ffe7059af96d523a (diff) | |
download | redmine-4714b310022d7c5da48686372a58e99d5368c9af.tar.gz redmine-4714b310022d7c5da48686372a58e99d5368c9af.zip |
Preload issues custom values for bulk operations.
git-svn-id: http://svn.redmine.org/redmine/trunk@14730 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/application_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4d9821c21..f11c04536 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -352,7 +352,10 @@ class ApplicationController < ActionController::Base # Find issues with a single :id param or :ids array param # Raises a Unauthorized exception if one of the issues is not visible def find_issues - @issues = Issue.where(:id => (params[:id] || params[:ids])).preload(:project, :status, :tracker, :priority, :author, :assigned_to, :relations_to).to_a + @issues = Issue. + where(:id => (params[:id] || params[:ids])). + preload(:project, :status, :tracker, :priority, :author, :assigned_to, :relations_to, {:custom_values => :custom_field}). + to_a raise ActiveRecord::RecordNotFound if @issues.empty? raise Unauthorized unless @issues.all?(&:visible?) @projects = @issues.collect(&:project).compact.uniq |