500问题

This commit is contained in:
huang 2015-11-27 18:36:38 +08:00
parent cb51545a31
commit ae9f1c704a
2 changed files with 13 additions and 9 deletions

View File

@ -81,9 +81,11 @@ class Comment < ActiveRecord::Base
# 课程成员得分(英雄榜) # 课程成员得分(英雄榜)
def act_as_student_score def act_as_student_score
if self.commented.course
unless self.author.allowed_to?(:as_teacher, self.commented.course) unless self.author.allowed_to?(:as_teacher, self.commented.course)
course_member_score(self.commented.course.id, self.author_id, "NewReply") course_member_score(self.commented.course.id, self.author_id, "NewReply")
end end
end end
end
end end

View File

@ -287,6 +287,7 @@ class Message < ActiveRecord::Base
# 课程成员得分(英雄榜) # 课程成员得分(英雄榜)
def act_as_student_score def act_as_student_score
if self.course
unless self.author.allowed_to?(:as_teacher, self.course) unless self.author.allowed_to?(:as_teacher, self.course)
if self.parent_id.nil? if self.parent_id.nil?
# 发帖 # 发帖
@ -298,3 +299,4 @@ class Message < ActiveRecord::Base
end end
end end
end end
end