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
246951bb
Commit
246951bb
authored
Aug 01, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unmemoize read_ability
since it's only called once now in make_recipient
parent
934305ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
notification_recipient_service.rb
app/services/notification_recipient_service.rb
+9
-8
No files found.
app/services/notification_recipient_service.rb
View file @
246951bb
...
@@ -87,13 +87,12 @@ module NotificationRecipientService
...
@@ -87,13 +87,12 @@ module NotificationRecipientService
end
end
def
read_ability
def
read_ability
@read_ability
||=
case
target
case
target
when
Issuable
when
Issuable
:"read_
#{
target
.
to_ability_name
}
"
:"read_
#{
target
.
to_ability_name
}
"
when
Ci
::
Pipeline
when
Ci
::
Pipeline
:read_build
# We have build trace in pipeline emails
:read_build
# We have build trace in pipeline emails
end
end
end
end
def
custom_action
def
custom_action
...
@@ -308,7 +307,9 @@ module NotificationRecipientService
...
@@ -308,7 +307,9 @@ module NotificationRecipientService
end
end
def
read_ability
def
read_ability
@read_ability
||=
:"read_
#{
target
.
class
.
model_name
.
name
.
underscore
}
"
return
nil
if
target
.
nil?
:"read_
#{
target
.
class
.
model_name
.
name
.
underscore
}
"
end
end
def
build!
def
build!
...
...
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