You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/db/migrate/20160113024927_statics_repo...

20 lines
434 B

class StaticsRepositoryCommits < ActiveRecord::Migration
def up
g = Gitlab.client
Project.all.each do |project|
unless project.gpid.nil?
begin
puts project.id
count = g.project(project.gpid).commit_count
rescue
logger.error("The project's rep is not exit!")
end
project.update_attribute(:commits_count, count)
end
end
end
def down
end
end