上线测试

This commit is contained in:
huang 2015-12-18 19:57:08 +08:00
parent e673540323
commit 747493993b
3 changed files with 26 additions and 3 deletions

View File

@ -22,10 +22,10 @@ module ProjectScoreHelper
#代码提交数量
def changesets_num project
# g = Gitlab.client
# project.gpid.nil? ? 0 : g.commits_total_count(project.gpid)
g = Gitlab.client
project.gpid.nil? ? 0 : g.commits_total_count(project.gpid)
# # commits_total_count(project.gpid)
project.changesets.count
# project.changesets.count
end
#讨论区帖子数量

View File

@ -0,0 +1,5 @@
class AddCommitsCountToProjects < ActiveRecord::Migration
def change
add_column :projects, :commits_count, :integer, default: 0
end
end

View File

@ -0,0 +1,18 @@
# #coding=utf-8
#
# namespace :projects do
# desc "sync some projects which just have sigle repository"
# task :commits_count => :environment do
# projects = Project.where("gpid is not null")
# puts projects.count
# projects.each do |project|
# unless project.gpid.nil?
# count =
# end
#
# end
# end
#
# task :delete_rep => :environment do
# end
# end