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.
15 lines
395 B
15 lines
395 B
5 years ago
|
class ApplyAddDepartment < ApplicationRecord
|
||
|
belongs_to :user
|
||
|
belongs_to :school
|
||
|
belongs_to :department
|
||
|
|
||
|
has_many :applied_messages, as: :applied
|
||
|
has_many :tidings, as: :container, dependent: :destroy
|
||
|
|
||
|
after_create :send_notify
|
||
|
|
||
|
private
|
||
|
def send_notify
|
||
|
tidings.create!(user_id: 1, trigger_user_id: user_id, belong_container: school, tiding_type: 'Apply', status: 0)
|
||
|
end
|
||
|
end
|