diff options
-rw-r--r-- | app/models/member.rb | 4 | ||||
-rw-r--r-- | app/models/members/group_member.rb | 4 | ||||
-rw-r--r-- | app/models/members/project_member.rb | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index dc9247bc9a0..b5f75c9bff0 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -332,4 +332,8 @@ class Member < ActiveRecord::Base def notification_service NotificationService.new end + + def notifiable?(type, opts={}) + raise 'abstract' + end end diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb index 47040f95533..cf434ec070b 100644 --- a/app/models/members/group_member.rb +++ b/app/models/members/group_member.rb @@ -30,6 +30,10 @@ class GroupMember < Member 'Group' end + def notifiable?(type, opts={}) + NotificationRecipientService.notifiable?(user, type, { group: group }.merge(opts)) + end + private def send_invite diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index c0e17f4bfc8..47e47caad82 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -87,6 +87,10 @@ class ProjectMember < Member project.owner == user end + def notifiable?(type, opts={}) + NotificationRecipientService.notifiable?(user, type, { project: project }.merge(opts)) + end + private def delete_member_todos |