From b6f066ddf326808f2a424356853acb9ff007abe7 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 27 Jan 2014 02:18:30 +0000 Subject: [PATCH] remove unneeded Relation#all from Project model git-svn-id: http://svn.redmine.org/redmine/trunk@12729 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index e2792c4ee..5aa7f86b8 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 -- 2.39.5