mirror of
https://github.com/redmine/redmine.git
synced 2026-02-16 19:47:40 +01:00
Preload project and user.
git-svn-id: http://svn.redmine.org/redmine/trunk@15940 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user