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.
12 lines
424 B
12 lines
424 B
6 years ago
|
class Grade < ApplicationRecord
|
||
|
|
||
|
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
|