BigW Consortium Gitlab

notifiable.rb 323 Bytes
Newer Older
Dmitriy Zaporozhets committed
1 2
# == Notifiable concern
#
3
# Contains notification functionality
Dmitriy Zaporozhets committed
4 5 6 7 8 9 10 11 12 13 14 15
#
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