BigW Consortium Gitlab

Commit 90dd3fb3 by http://jneen.net/

a membership with no user is always notifiable

since this is for user invites and the like.
parent 0268fc2f
...@@ -276,6 +276,14 @@ class Member < ActiveRecord::Base ...@@ -276,6 +276,14 @@ class Member < ActiveRecord::Base
@notification_setting ||= user.notification_settings_for(source) @notification_setting ||= user.notification_settings_for(source)
end 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 private
def send_invite def send_invite
...@@ -333,7 +341,7 @@ class Member < ActiveRecord::Base ...@@ -333,7 +341,7 @@ class Member < ActiveRecord::Base
NotificationService.new NotificationService.new
end end
def notifiable?(type, opts={}) def notifiable_options
raise 'abstract' {}
end end
end end
...@@ -30,8 +30,8 @@ class GroupMember < Member ...@@ -30,8 +30,8 @@ class GroupMember < Member
'Group' 'Group'
end end
def notifiable?(type, opts={}) def notifiable_options
NotificationRecipientService.notifiable?(user, type, { group: group }.merge(opts)) { group: group }
end end
private private
......
...@@ -87,8 +87,8 @@ class ProjectMember < Member ...@@ -87,8 +87,8 @@ class ProjectMember < Member
project.owner == user project.owner == user
end end
def notifiable?(type, opts={}) def notifiable_options
NotificationRecipientService.notifiable?(user, type, { project: project }.merge(opts)) { project: project }
end end
private private
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment