From: Toshi MARUYAMA Date: Mon, 27 Jan 2014 02:18:30 +0000 (+0000) Subject: remove unneeded Relation#all from Project model X-Git-Tag: 2.5.0~171 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6f066ddf326808f2a424356853acb9ff007abe7;p=redmine.git remove unneeded Relation#all from Project model git-svn-id: http://svn.redmine.org/redmine/trunk@12729 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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