From 39c97279ca6fe8864d44f6892f8769f656cba487 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 25 Feb 2010 04:55:33 +0000 Subject: [PATCH] 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 --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index e2577c3e6..d5941e095 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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