Skip to content
Snippets Groups Projects
Commit 90dd3fb3 authored by http://jneen.net/'s avatar http://jneen.net/
Browse files

a membership with no user is always notifiable

since this is for user invites and the like.
parent 0268fc2f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -276,6 +276,14 @@ class Member < ActiveRecord::Base
@notification_setting ||= user.notification_settings_for(source)
end
 
def notifiable?(type, opts={})
# always notify when there isn't a user yet
return true if user.blank?
NotificationRecipientService.notifiable?(user, type, notifiable_options.merge(opts))
end
private
 
def send_invite
Loading
Loading
@@ -333,7 +341,7 @@ class Member < ActiveRecord::Base
NotificationService.new
end
 
def notifiable?(type, opts={})
raise 'abstract'
def notifiable_options
{}
end
end
Loading
Loading
@@ -30,8 +30,8 @@ class GroupMember < Member
'Group'
end
 
def notifiable?(type, opts={})
NotificationRecipientService.notifiable?(user, type, { group: group }.merge(opts))
def notifiable_options
{ group: group }
end
 
private
Loading
Loading
Loading
Loading
@@ -87,8 +87,8 @@ class ProjectMember < Member
project.owner == user
end
 
def notifiable?(type, opts={})
NotificationRecipientService.notifiable?(user, type, { project: project }.merge(opts))
def notifiable_options
{ project: project }
end
 
private
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment