Commit f3cbbfe020678d6734573bc3f21b53f8c2668070
1 parent
f0606451
Exists in
master
and in
4 other branches
Notifiable concern
Showing
1 changed file
with
15 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +# == Notifiable concern | |
| 2 | +# | |
| 3 | +# Contains notification functionality shared between UsersProject and UsersGroup | |
| 4 | +# | |
| 5 | +module Notifiable | |
| 6 | + extend ActiveSupport::Concern | |
| 7 | + | |
| 8 | + included do | |
| 9 | + validates :notification_level, inclusion: { in: Notification.project_notification_levels }, presence: true | |
| 10 | + end | |
| 11 | + | |
| 12 | + def notification | |
| 13 | + @notification ||= Notification.new(self) | |
| 14 | + end | |
| 15 | +end | ... | ... |