summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-20 11:38:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-20 11:38:27 +0000
commit28fc7df5c47095f46f3aea04c8ca913caada1c56 (patch)
tree79031fb1b596da307cfe376a6fac0d1d24448152
parentd12a3d345c91b885d019db667066bde05203fed1 (diff)
downloadredmine-28fc7df5c47095f46f3aea04c8ca913caada1c56.tar.gz
redmine-28fc7df5c47095f46f3aea04c8ca913caada1c56.zip
Issue#editable_custom_field_values very slow for issues with many custom fields (#23334).
Patch by Stephane Evr. git-svn-id: http://svn.redmine.org/redmine/trunk@15742 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/issue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 0b8a2b2c5..a8d5e52b7 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -574,8 +574,9 @@ class Issue < ActiveRecord::Base
# Returns the custom_field_values that can be edited by the given user
def editable_custom_field_values(user=nil)
+ read_only = read_only_attribute_names(user)
visible_custom_field_values(user).reject do |value|
- read_only_attribute_names(user).include?(value.custom_field_id.to_s)
+ read_only.include?(value.custom_field_id.to_s)
end
end