summaryrefslogtreecommitdiff
path: root/app/models/concerns/notifiable.rb
blob: d7dcd97911dd4825987855a38d5723e6550180d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# == Notifiable concern
#
# Contains notification functionality
#
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