unmemoize read_ability
since it's only called once now in make_recipient
This commit is contained in:
parent
934305ffa3
commit
246951bba7
1 changed files with 9 additions and 8 deletions
|
@ -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
|
||||||
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!
|
||||||
|
|
Loading…
Reference in a new issue