summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-03-15 11:06:50 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-03-15 11:06:50 +0100
commitc51c901916c9092a97f6a11f7bc64ad25536ea19 (patch)
treee00efac034863c26cb9ef90bfc0ad96cc08993f5
parent9403142083bf0ace81fc3059f2d6c5a494e48cbf (diff)
downloadgitlab-ce-external-issue-tracker.tar.gz
Return the external issue tracker even if it's nullexternal-issue-tracker
This solves the problem with caching the nil value with instance variable. Without this the every time we ask for external_issue_tracker we built AR and potentially do SQL query
-rw-r--r--app/models/project.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 79e0cc7b23d..346cd6222cf 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -508,6 +508,7 @@ class Project < ActiveRecord::Base
end
def external_issue_tracker
+ return @external_issue_tracker if defined?(@external_issue_tracker)
@external_issue_tracker ||=
services.issue_trackers.active.without_defaults.first
end