Commit 39c97279 authored by Eric Davis's avatar Eric Davis

Optimize: Only select the name when getting the module names.

This has speed up TimelogController#details by 100% with larger databases
(demo.redmine went from 4077ms down to 2085ms).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3484 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f7bd0801
......@@ -639,7 +639,7 @@ class Project < ActiveRecord::Base
def allowed_permissions
@allowed_permissions ||= begin
module_names = enabled_modules.collect {|m| m.name}
module_names = enabled_modules.all(:select => :name).collect {|m| m.name}
Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
end
end
......
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