From a3fb08817cc29bee12a3e007477f7e08b9b5199e Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 16 Aug 2014 15:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=95=B0=E4=B8=8D=E8=83=BD=E4=B8=BA0?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.txt | 7 ++ app/helpers/user_score_helper.rb | 3 + app/views/layouts/base_projects.html.erb | 2 +- db/schema.rb | 95 ++++++++++++++++++++---- 4 files changed, 90 insertions(+), 17 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index 7e8af4e21..538457d3d 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -81,3 +81,10 @@ kw: 默认支持如下格式:"bmp,jpeg,jpg,png,gif" 可在configuration.yml中修改,格式:pic_types: "bmp,jpeg,jpg,png,gif"(注意:pic_types若前面有#号需去掉) 配置完成后重启服务 + +=================================[2014-08-16]==================================== +kw:数据迁移,project_scores表已存在 +bundle exec rake db:migrate:down VERSION=20140811022947 +bundle exec rake db:migrate:up VERSION=20140811022947 +bundle exec rake db:migrate +bundle exec rake project_score:calculate diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index 38f4f91f0..e981f16a1 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -384,6 +384,9 @@ module UserScoreHelper #鏇存柊鍒嗘暟 def update_score(option_number) option_number.total_score = collaboration(option_number) + influence(option_number) + skill(option_number) + active(option_number) + if option_number.total_score < 0 + option_number.total_score = 0 + end option_number.save option_number.total_score end diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index d8eb17acd..711a9c337 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -54,7 +54,7 @@