Commit f3cbbfe020678d6734573bc3f21b53f8c2668070

Authored by Dmitriy Zaporozhets
1 parent f0606451

Notifiable concern

Showing 1 changed file with 15 additions and 0 deletions   Show diff stats
app/models/concerns/notifiable.rb 0 → 100644
@@ -0,0 +1,15 @@ @@ -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