diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a3fbae5aa..7f42fff76 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -298,7 +298,7 @@ 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.find_all_by_id(params[:id] || params[:ids]) + @issues = Issue.where(:id => (params[:id] || params[:ids])).preload(:project, :status, :tracker, :priority, :author, :assigned_to, :relations_to).to_a raise ActiveRecord::RecordNotFound if @issues.empty? raise Unauthorized unless @issues.all?(&:visible?) @projects = @issues.collect(&:project).compact.uniq