summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-05-23 10:43:55 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-05-24 10:02:32 +0200
commit3be9820da63d77ab8b4469dbbb5385292f928057 (patch)
treeaa8317a5e7736183f731ebd85be462efd23a1f82 /app/models/deployment.rb
parentf0cd6ffd0bec0c8a612a7af6e8a9a0a6fa5d31a4 (diff)
downloadgitlab-ce-3be9820da63d77ab8b4469dbbb5385292f928057.tar.gz
Test etag caching router and incorporate review
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 216cec751e3..304179c0a97 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -12,6 +12,7 @@ class Deployment < ActiveRecord::Base
delegate :name, to: :environment, prefix: true
after_create :create_ref
+ after_create :invalidate_cache
def commit
project.commit(sha)
@@ -33,6 +34,10 @@ class Deployment < ActiveRecord::Base
project.repository.create_ref(ref, ref_path)
end
+ def invalidate_cache
+ environment.expire_etag_cache
+ end
+
def manual_actions
@manual_actions ||= deployable.try(:other_actions)
end