BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
58dd4a09
Commit
58dd4a09
authored
Apr 09, 2018
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor `add_recipients`
parent
b8c098ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
notification_recipient_service.rb
app/services/notification_recipient_service.rb
+2
-3
No files found.
app/services/notification_recipient_service.rb
View file @
58dd4a09
...
@@ -51,11 +51,10 @@ module NotificationRecipientService
...
@@ -51,11 +51,10 @@ module NotificationRecipientService
def
add_recipients
(
users
,
type
,
reason
)
def
add_recipients
(
users
,
type
,
reason
)
if
users
.
is_a?
(
ActiveRecord
::
Relation
)
if
users
.
is_a?
(
ActiveRecord
::
Relation
)
users
=
users
.
includes
(
:notification_settings
)
.
to_a
users
=
users
.
includes
(
:notification_settings
)
end
end
users
=
Array
(
users
)
users
=
Array
(
users
).
compact
users
.
compact!
recipients
.
concat
(
users
.
map
{
|
u
|
make_recipient
(
u
,
type
,
reason
)
})
recipients
.
concat
(
users
.
map
{
|
u
|
make_recipient
(
u
,
type
,
reason
)
})
end
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