Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
90dd3fb3
Commit
90dd3fb3
authored
Aug 04, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a membership with no user is always notifiable
since this is for user invites and the like.
parent
0268fc2f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
app/models/member.rb
app/models/member.rb
+10
-2
app/models/members/group_member.rb
app/models/members/group_member.rb
+2
-2
app/models/members/project_member.rb
app/models/members/project_member.rb
+2
-2
No files found.
app/models/member.rb
View file @
90dd3fb3
...
...
@@ -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
app/models/members/group_member.rb
View file @
90dd3fb3
...
...
@@ -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
...
...
app/models/members/project_member.rb
View file @
90dd3fb3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment