Fixed: Repository.fetch_changesets tries to fetch changesets for archived projects (#4782).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3402 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2010-02-09 18:42:42 +00:00
parent f50feca730
commit d04d3f181a
1 changed files with 7 additions and 3 deletions

View File

@ -159,11 +159,15 @@ class Repository < ActiveRecord::Base
end
end
# fetch new changesets for all repositories
# can be called periodically by an external script
# Fetches new changesets for all repositories of active projects
# Can be called periodically by an external script
# eg. ruby script/runner "Repository.fetch_changesets"
def self.fetch_changesets
find(:all).each(&:fetch_changesets)
Project.active.has_module(:repository).find(:all, :include => :repository).each do |project|
if project.repository
project.repository.fetch_changesets
end
end
end
# scan changeset comments to find related and fixed issues for all repositories