From bc587f3e7daf1fad7fd8d5f1a0f95ff3dfacca93 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Jun 2014 11:15:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E4=B8=AA=E4=BA=BA=E5=88=86?= =?UTF-8?q?=E6=95=B0=E5=AE=9E=E6=97=B6=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E5=88=86=E6=95=B0?= =?UTF-8?q?=E8=AE=A1=E5=88=86=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user_score.rb | 6 +++--- app/views/layouts/base_users.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user_score.rb b/app/models/user_score.rb index 1635d612f..6371fc12d 100644 --- a/app/models/user_score.rb +++ b/app/models/user_score.rb @@ -53,7 +53,7 @@ class UserScore < ActiveRecord::Base user_score = current_user.user_score_attr user_grade = nil #项目个人得分 project = obj.project - unless project.nil? && project.project_type == 0 + unless project.nil? user_grade = UserGrade.find_by_user_id_and_project_id(current_user.id, project.id) if user_grade.nil? user_grade = UserGrade.create(:user_id => current_user.id,:project_id => project.id) @@ -178,7 +178,7 @@ class UserScore < ActiveRecord::Base current_user_grade = nil #项目个人得分 target_user_grade = nil project = obj.project - unless project.nil? && project.project_type == 0 + unless project.nil? current_user_grade = UserGrade.find_by_user_id_and_project_id(current_user.id, project.id) target_user_grade = UserGrade.find_by_user_id_and_project_id(target_user.id, project.id) if current_user_grade.nil? @@ -285,7 +285,7 @@ class UserScore < ActiveRecord::Base user_score = current_user.try(:user_score_attr) user_grade = nil #项目个人得分 project = obj.project - unless project.nil? && project.project_type == 0 + unless project.nil? user_grade = UserGrade.find_by_user_id_and_project_id(current_user.id, project.id) if user_grade.nil? user_grade = UserGrade.create(:user_id => current_user.id,:project_id => project.id) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 5579dfb5b..0f7c273f1 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -35,7 +35,7 @@ - +