From: Dmitriy Zaporozhets Date: Fri, 21 Jun 2013 20:17:41 +0000 (+0300) Subject: Notifiable concern X-Git-Tag: v6.0.0~215^2~102 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f3cbbfe020678d6734573bc3f21b53f8c2668070;p=wvm%2Fgitlab.git Notifiable concern --- diff --git a/app/models/concerns/notifiable.rb b/app/models/concerns/notifiable.rb new file mode 100644 index 000000000..722f375e7 --- /dev/null +++ b/app/models/concerns/notifiable.rb @@ -0,0 +1,15 @@ +# == 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