Commit 6a93e1dc authored by jplang's avatar jplang

Preload project and user.

git-svn-id: https://svn.redmine.org/redmine/trunk@15940 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 53b82dd3
......@@ -230,7 +230,7 @@ private
end
def find_time_entries
@time_entries = TimeEntry.where(:id => params[:id] || params[:ids]).to_a
@time_entries = TimeEntry.where(:id => params[:id] || params[:ids]).preload(:project, :user).to_a
raise ActiveRecord::RecordNotFound if @time_entries.empty?
raise Unauthorized unless @time_entries.all? {|t| t.editable_by?(User.current)}
@projects = @time_entries.collect(&:project).compact.uniq
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment