Commit daafe5d3 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'external-issue-tracker' into 'master'

Use strong_memoize for external_issue_trackers

See merge request gitlab-org/gitlab!29276
parents d2baf7a7 326b23a2
...@@ -1190,14 +1190,14 @@ class Project < ApplicationRecord ...@@ -1190,14 +1190,14 @@ class Project < ApplicationRecord
end end
def external_issue_tracker def external_issue_tracker
if has_external_issue_tracker.nil? # To populate existing projects if has_external_issue_tracker.nil?
cache_has_external_issue_tracker cache_has_external_issue_tracker
end end
if has_external_issue_tracker? if has_external_issue_tracker?
return @external_issue_tracker if defined?(@external_issue_tracker) strong_memoize(:external_issue_tracker) do
services.external_issue_trackers.first
@external_issue_tracker = services.external_issue_trackers.first end
else else
nil nil
end end
...@@ -1217,7 +1217,7 @@ class Project < ApplicationRecord ...@@ -1217,7 +1217,7 @@ class Project < ApplicationRecord
def external_wiki def external_wiki
if has_external_wiki.nil? if has_external_wiki.nil?
cache_has_external_wiki # Populate cache_has_external_wiki
end end
if has_external_wiki if has_external_wiki
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment