]> source.dussan.org Git - redmine.git/commitdiff
remove unneeded Relation#all from Project model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 27 Jan 2014 02:18:30 +0000 (02:18 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 27 Jan 2014 02:18:30 +0000 (02:18 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12729 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb

index e2792c4ee08189a8569ed71004a5d9d51366f3a6..5aa7f86b842083516959f263348e6b727c2cad76 100644 (file)
@@ -440,7 +440,7 @@ class Project < ActiveRecord::Base
   # Closes open and locked project versions that are completed
   def close_completed_versions
     Version.transaction do
-      versions.where(:status => %w(open locked)).all.each do |version|
+      versions.where(:status => %w(open locked)).each do |version|
         if version.completed?
           version.update_attribute(:status, 'closed')
         end
@@ -480,7 +480,7 @@ class Project < ActiveRecord::Base
 
   # Returns a hash of project users grouped by role
   def users_by_role
-    members.includes(:user, :roles).all.inject({}) do |h, m|
+    members.includes(:user, :roles).inject({}) do |h, m|
       m.roles.each do |r|
         h[r] ||= []
         h[r] << m.user