diff app/models/issue_query.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
line wrap: on
line diff
--- a/app/models/issue_query.rb	Tue Sep 09 09:28:31 2014 +0100
+++ b/app/models/issue_query.rb	Tue Sep 09 09:29:00 2014 +0100
@@ -142,7 +142,7 @@
       if all_projects.any?
         principals += Principal.member_of(all_projects)
       end
-      versions = Version.visible.find_all_by_sharing('system')
+      versions = Version.visible.where(:sharing => 'system').all
       issue_custom_fields = IssueCustomField.where(:is_for_all => true)
     end
     principals.uniq!
@@ -150,7 +150,7 @@
     users = principals.select {|p| p.is_a?(User)}
 
     add_available_filter "status_id",
-      :type => :list_status, :values => IssueStatus.sorted.all.collect{|s| [s.name, s.id.to_s] }
+      :type => :list_status, :values => IssueStatus.sorted.collect{|s| [s.name, s.id.to_s] }
 
     if project.nil?
       project_values = []
@@ -333,8 +333,9 @@
       limit(options[:limit]).
       offset(options[:offset])
 
-    if has_custom_field_column?
-      scope = scope.preload(:custom_values)
+    scope = scope.preload(:custom_values)
+    if has_column?(:author)
+      scope = scope.preload(:author)
     end
 
     issues = scope.all
@@ -409,7 +410,7 @@
       groups = Group.all
       operator = '!' # Override the operator since we want to find by assigned_to
     else
-      groups = Group.find_all_by_id(value)
+      groups = Group.where(:id => value).all
     end
     groups ||= []