瀏覽代碼

Preload project and user.

git-svn-id: http://svn.redmine.org/redmine/trunk@15940 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang 7 年之前
父節點
當前提交
ed4c0886e2
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      app/controllers/timelog_controller.rb

+ 1
- 1
app/controllers/timelog_controller.rb 查看文件

@@ -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

Loading…
取消
儲存