summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2018-12-20 09:39:09 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-01-02 17:36:27 +0000
commitd2f5bf39cca7684f4834bfc8d7614901c7cd2542 (patch)
tree4c55d3bfffe2042df346dc0fa99df208d239c256 /app/models
parent019f616c7275db84a798dd933ac7d3317ffa0b50 (diff)
downloadgitlab-ce-d2f5bf39cca7684f4834bfc8d7614901c7cd2542.tar.gz
Merge branch '55103-hide-group-cluster-features' into 'master'
Resolve "Hide cluster features that don't work yet with Group Clusters" Closes #55103 See merge request gitlab-org/gitlab-ce!23935 (cherry picked from commit a91138baaba93b72c3b487d38e11299e99d2071e) 4ed4a640 Expose environment's cluster type 55bfea0a Disable terminal button for group clusters bfbea9b8 Use constants for cluster_type b1fb15f8 Fix formatting e9c4f190 Add CHANGELOG.md entry for gitlab-ce!23935 0d608a7b Add test for environment_terminal_button e18fb5b3 Memoize call for EnvironmentEntity#cluster_type a45fb5d6 Moves memoization to Environment
Diffstat (limited to 'app/models')
-rw-r--r--app/models/environment.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 934828946b9..cdfe3b7c023 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
class Environment < ActiveRecord::Base
+ include Gitlab::Utils::StrongMemoize
# Used to generate random suffixes for the slug
LETTERS = 'a'..'z'
NUMBERS = '0'..'9'
@@ -231,7 +232,9 @@ class Environment < ActiveRecord::Base
end
def deployment_platform
- project.deployment_platform(environment: self.name)
+ strong_memoize(:deployment_platform) do
+ project.deployment_platform(environment: self.name)
+ end
end
private