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

16 lines
323 B
Ruby
Raw Normal View History

2013-06-21 20:17:41 +00:00
# == Notifiable concern
#
# Contains notification functionality
2013-06-21 20:17:41 +00:00
#
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