diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-06 13:47:52 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-06 13:47:52 +0100 |
commit | 9cee280d7045d87a4c0854c0c281c98ba3a085e7 (patch) | |
tree | d65da90310054d83a81588a4886f11c88c59ca5c /app/models/issue.rb | |
parent | 2a18425e97023b05aa52c29dbce6c5a7aa7400b7 (diff) | |
parent | 66d03aae98cc0429d2ed75eac68025f447868479 (diff) | |
download | gitlab-ce-9cee280d7045d87a4c0854c0c281c98ba3a085e7.tar.gz |
Merge branch 'update-droplab-to-webpack-version' into new-resolvable-discussion
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 5010b6e1edf..d8d9db477d2 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -41,6 +41,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 @@ -253,4 +255,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 |