diff --git a/app/models/concerns/notifiable.rb b/app/models/concerns/notifiable.rb new file mode 100644 index 00000000000..722f375e71d --- /dev/null +++ b/app/models/concerns/notifiable.rb @@ -0,0 +1,15 @@ +# == Notifiable concern +# +# Contains notification functionality shared between UsersProject and UsersGroup +# +module Notifiable + extend ActiveSupport::Concern + + included do + validates :notification_level, inclusion: { in: Notification.project_notification_levels }, presence: true + end + + def notification + @notification ||= Notification.new(self) + end +end