summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/environment.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 07722d9a59e..6211a5c1e63 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -202,11 +202,16 @@ class Environment < ActiveRecord::Base
def expire_etag_cache
Gitlab::EtagCaching::Store.new.tap do |store|
- store.touch(Gitlab::Routing.url_helpers
- .namespace_project_environments_path(project.namespace, project))
+ store.touch(etag_cache_key)
end
end
+ def etag_cache_key
+ Gitlab::Routing.url_helpers.namespace_project_environments_path(
+ project.namespace,
+ project)
+ end
+
private
# Slugifying a name may remove the uniqueness guarantee afforded by it being