summaryrefslogtreecommitdiffstats
path: root/app/controllers/timelog_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-03 08:38:40 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-03 08:38:40 +0000
commitbde77eebe301f1463e7791025b583fb7a031447a (patch)
tree35a60fbb65adfc0fa64de31c0c98669e70e49716 /app/controllers/timelog_controller.rb
parent9160c401e3b13f089d8d9832f58943fc0b38878d (diff)
downloadredmine-bde77eebe301f1463e7791025b583fb7a031447a.tar.gz
redmine-bde77eebe301f1463e7791025b583fb7a031447a.zip
Merged r15952 and r15953 (#23922).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16043 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/timelog_controller.rb')
-rw-r--r--app/controllers/timelog_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 7e4d6b71d..acb106d3b 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -170,7 +170,7 @@ class TimelogController < ApplicationController
end
def bulk_edit
- @available_activities = TimeEntryActivity.shared.active
+ @available_activities = @projects.map(&:activities).reduce(:&)
@custom_fields = TimeEntry.first.available_custom_fields
end
@@ -236,7 +236,10 @@ 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 => :time_entry_activities).
+ preload(: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