]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Repository.fetch_changesets tries to fetch changesets for archived projects...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 9 Feb 2010 18:42:42 +0000 (18:42 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 9 Feb 2010 18:42:42 +0000 (18:42 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3402 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index 9f0861b1ac2a14e5b48b26c64ed9f2fa975ee77b..da1168dfd4e28ac454834f43eabf7a8a1e8ac220 100644 (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