gitlab-org--gitlab-foss/app/models/concerns/notifiable.rb

16 lines
366 B
Ruby
Raw Normal View History

2013-06-21 16:17:41 -04:00
# == 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