1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-05 16:24:21 +01:00
fab-manager/app/models/user_training.rb

16 lines
401 B
Ruby
Raw Normal View History

2016-03-23 18:39:41 +01:00
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