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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ddd6f804
Commit
ddd6f804
authored
May 13, 2019
by
Wei-Meng Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move method into group
parent
f7238306
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
app/mailers/notify.rb
app/mailers/notify.rb
+1
-1
app/models/group.rb
app/models/group.rb
+4
-0
No files found.
app/mailers/notify.rb
View file @
ddd6f804
...
...
@@ -82,7 +82,7 @@ class Notify < BaseMailer
group_notification_email
=
nil
if
notification_group
notification_settings
=
notification_group
.
notification_settings
(
hierarchy_order: :asc
).
where
(
user:
@current_user
)
# rubocop: disable CodeReuse/ActiveRecord
notification_settings
=
notification_group
.
notification_settings
_for
(
@current_user
,
hierarchy_order: :asc
)
group_notification_email
=
notification_settings
.
find
{
|
n
|
n
.
notification_email
.
present?
}
&
.
notification_email
end
...
...
app/models/group.rb
View file @
ddd6f804
...
...
@@ -138,6 +138,10 @@ class Group < Namespace
.
order
(
"ordered_groups.depth
#{
hierarchy_order
}
"
)
end
def
notification_settings_for
(
user
,
hierarchy_order:
nil
)
notification_settings
(
hierarchy_order:
hierarchy_order
).
where
(
user:
user
)
end
def
to_reference
(
_from
=
nil
,
full:
nil
)
"
#{
self
.
class
.
reference_prefix
}#{
full_path
}
"
end
...
...
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