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

16 lines
323 B
Ruby
Raw Normal View History

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