Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
commit
f796aa1489
@ -1,3 +1,11 @@
|
||||
$('#praise_tread').html('<%= j(
|
||||
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id,:horizontal=>@horizontal}
|
||||
)%>');
|
||||
<% if @activity %>
|
||||
<% if @type.to_s == 'activity' %>
|
||||
$('#praise_count_<%=@user_activity_id %>').html('<%= j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
|
||||
<% else @type.to_s == 'reply' %>
|
||||
$('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
<% end %>
|
||||
<% else %>
|
||||
$('#praise_tread').html('<%= j(
|
||||
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id,:horizontal=>@horizontal}
|
||||
)%>');
|
||||
<% end %>
|
@ -0,0 +1,32 @@
|
||||
class UpdateRepCommits < ActiveRecord::Migration
|
||||
def up
|
||||
project_count = Project.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... project_count do i
|
||||
Project.page(i).per(30).each do |project|
|
||||
puts project.id
|
||||
if ProjectScore.where("project_id=?", project.id).first.nil?
|
||||
puts "create project ==>#{project.id}"
|
||||
ProjectScore.create(:project_id => project.id, :score => false)
|
||||
end
|
||||
unless project.project_score.nil?
|
||||
# update boards
|
||||
unless project.gpid.nil?
|
||||
g = Gitlab.client
|
||||
begin
|
||||
puts project.id
|
||||
count = g.project(project.gpid).commit_count
|
||||
rescue
|
||||
logger.error("The project's rep is not exit!")
|
||||
end
|
||||
project.project_score.update_attribute(:changeset_num, count)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 8.2 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue