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
This commit is contained in:
parent
f7bd0801f6
commit
39c97279ca
|
@ -639,7 +639,7 @@ class Project < ActiveRecord::Base
|
||||||
|
|
||||||
def allowed_permissions
|
def allowed_permissions
|
||||||
@allowed_permissions ||= begin
|
@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}
|
Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue