summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-04-06 13:40:30 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-04-06 13:40:30 +0000
commit88f33a1266ca51d48272e858c399daedd837575f (patch)
tree9c0da433d01a0cf01cdc0ded774c8b85a949403f /app/models/issue.rb
parentb3ea598b1aeaf7f3eb0071b60f97247ad67e69f4 (diff)
parent8199ff7bd71ce91fbc945b2c31010fcf654bda67 (diff)
downloadgitlab-ce-update-trace-handling-code.tar.gz
Merge branch 'master' into 'update-trace-handling-code'update-trace-handling-code
# Conflicts: # app/assets/javascripts/build.js
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 472796df9df..f9704b0d754 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -40,6 +40,8 @@ class Issue < ActiveRecord::Base
scope :include_associations, -> { includes(:assignee, :labels, project: :namespace) }
+ after_save :expire_etag_cache
+
attr_spammable :title, spam_title: true
attr_spammable :description, spam_description: true
@@ -252,4 +254,13 @@ class Issue < ActiveRecord::Base
def publicly_visible?
project.public? && !confidential?
end
+
+ def expire_etag_cache
+ key = Gitlab::Routing.url_helpers.rendered_title_namespace_project_issue_path(
+ project.namespace,
+ project,
+ self
+ )
+ Gitlab::EtagCaching::Store.new.touch(key)
+ end
end