Notifiable concern

This commit is contained in:
Dmitriy Zaporozhets 2013-06-21 23:17:41 +03:00
parent f060645119
commit f3cbbfe020
1 changed files with 15 additions and 0 deletions

View File

@ -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