mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
16 lines
401 B
Ruby
16 lines
401 B
Ruby
|
class UserTraining < ActiveRecord::Base
|
||
|
include NotifyWith::NotificationAttachedObject
|
||
|
|
||
|
belongs_to :user
|
||
|
belongs_to :training
|
||
|
|
||
|
after_commit :notify_user_training_valid, on: :create
|
||
|
|
||
|
private
|
||
|
def notify_user_training_valid
|
||
|
NotificationCenter.call type: 'notify_user_training_valid',
|
||
|
receiver: user,
|
||
|
attached_object: self
|
||
|
end
|
||
|
end
|