Class: Course::AchievementNotifier

Inherits:
Notifier::Base
  • Object
show all
Defined in:
app/notifiers/course/achievement_notifier.rb

Instance Method Summary collapse

Instance Method Details

#achievement_gained(user, achievement) ⇒ Object

To be called when user gained an achievement.


4
5
6
7
8
9
# File 'app/notifiers/course/achievement_notifier.rb', line 4

def achievement_gained(user, achievement)
  create_activity(actor: user, object: achievement, event: :gained).
    notify(achievement.course, :feed).
    notify(user, :popup).
    save
end