remove unneeded Relation#all from Project model

git-svn-id: http://svn.redmine.org/redmine/trunk@12729 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-27 02:18:30 +00:00
parent 051ed3557b
commit b6f066ddf3
1 changed files with 2 additions and 2 deletions

View 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