500问题
This commit is contained in:
parent
cb51545a31
commit
ae9f1c704a
|
@ -81,8 +81,10 @@ class Comment < ActiveRecord::Base
|
||||||
|
|
||||||
# 课程成员得分(英雄榜)
|
# 课程成员得分(英雄榜)
|
||||||
def act_as_student_score
|
def act_as_student_score
|
||||||
unless self.author.allowed_to?(:as_teacher, self.commented.course)
|
if self.commented.course
|
||||||
course_member_score(self.commented.course.id, self.author_id, "NewReply")
|
unless self.author.allowed_to?(:as_teacher, self.commented.course)
|
||||||
|
course_member_score(self.commented.course.id, self.author_id, "NewReply")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -287,13 +287,15 @@ class Message < ActiveRecord::Base
|
||||||
|
|
||||||
# 课程成员得分(英雄榜)
|
# 课程成员得分(英雄榜)
|
||||||
def act_as_student_score
|
def act_as_student_score
|
||||||
unless self.author.allowed_to?(:as_teacher, self.course)
|
if self.course
|
||||||
if self.parent_id.nil?
|
unless self.author.allowed_to?(:as_teacher, self.course)
|
||||||
# 发帖
|
if self.parent_id.nil?
|
||||||
course_member_score(self.course.id, self.author_id, "Message")
|
# 发帖
|
||||||
else
|
course_member_score(self.course.id, self.author_id, "Message")
|
||||||
# 回帖
|
else
|
||||||
course_member_score(self.course.id, self.author_id, "MessageReply")
|
# 回帖
|
||||||
|
course_member_score(self.course.id, self.author_id, "MessageReply")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue