Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-26 00:09:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-26 00:09:23 +0300
commit32fd4cd5e2134511936899d6bcc4aaf18b9be6fd (patch)
tree10378ceffed52dd0e160a0d9bcf3c5ab72c18958 /app/models/environment_status.rb
parent951616a26a61e880860ad862c1d45a8e3762b4bc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/environment_status.rb')
-rw-r--r--app/models/environment_status.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/environment_status.rb b/app/models/environment_status.rb
index 5fdb5af2d9b..46e41c22139 100644
--- a/app/models/environment_status.rb
+++ b/app/models/environment_status.rb
@@ -62,9 +62,9 @@ class EnvironmentStatus
end
def changes
- return [] unless has_route_map?
-
- changed_files.map { |file| build_change(file) }.compact
+ strong_memoize(:changes) do
+ has_route_map? ? changed_files.map { |file| build_change(file) }.compact : []
+ end
end
def changed_files
@@ -72,6 +72,14 @@ class EnvironmentStatus
.merge_request_diff_files.where(deleted_file: false)
end
+ def changed_paths
+ changes.map { |change| change[:path] }
+ end
+
+ def changed_urls
+ changes.map { |change| change[:external_url] }
+ end
+
def has_route_map?
project.route_map_for(sha).present?
end