]> source.dussan.org Git - redmine.git/commitdiff
Prevent N queries on custom_fields when call /issues API.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Feb 2014 11:23:39 +0000 (11:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Feb 2014 11:23:39 +0000 (11:23 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12913 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index b9a2b20a9c7f5c6266f8b13ebb3aacb4806fb249..2c2e9f087f82d5951397fa7627a006c2dd767312 100644 (file)
@@ -200,7 +200,7 @@ class Issue < ActiveRecord::Base
 
   # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
   def available_custom_fields
-    (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields.all) : []
+    (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields) : []
   end
 
   def visible_custom_field_values(user=nil)