diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-08-04 13:56:33 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-08-11 16:02:04 -0700 |
commit | 90dd3fb32c1205ddd31c1c2c89b297e9528e0da8 (patch) | |
tree | fa321923853430bce44f3ca5a00861771db6645f /app/models/member.rb | |
parent | 0268fc2ffc7cdc12a6e1a0bf565fe70ff8541398 (diff) | |
download | gitlab-ce-90dd3fb32c1205ddd31c1c2c89b297e9528e0da8.tar.gz |
a membership with no user is always notifiable
since this is for user invites and the like.
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index b5f75c9bff0..57f85a9adaf 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -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 @@ -333,7 +341,7 @@ class Member < ActiveRecord::Base NotificationService.new end - def notifiable?(type, opts={}) - raise 'abstract' + def notifiable_options + {} end end |