You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/models/grade.rb

16 lines
893 B

6 years ago
# container_type:
# Phone-手机注册Mail-邮箱绑定Account-完善资料Answer-查看参考答案Game-闯关; testSet-查看测试集; #shixunPublish-实训发布
# Avatar-首次上传头像 Attendance-签到 Memo/Discusses-发布帖子或评论 Star-实训评分获得的随机奖励 CheckTaAnswer-查看他人答案
# Feedback-反馈问题 Authentication-实名认证 Professional-职业认证
class Grade < ActiveRecord::Base
attr_accessible :container_id, :container_type, :score, :user_id
belongs_to :user
has_many :tidings, :as => :container, :dependent => :destroy
after_create :send_tiding
def send_tiding
self.tidings << Tiding.new(:user_id => self.user_id, :trigger_user_id => 0, :parent_container_id => self.container_id,
:parent_container_type => self.container_type, :viewed => 0, :tiding_type => "System")
end
end