BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
472c2e6a
Commit
472c2e6a
authored
Apr 12, 2017
by
Sean McGivern
Committed by
James Lopez
Apr 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '30457-expire-note-destroy' into 'master'
Fix issue's note cache expiration after delete Closes #30457 See merge request !10461
parent
d02b0e3a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
note.rb
app/models/note.rb
+1
-0
30457-expire-note-destroy.yml
changelogs/unreleased/30457-expire-note-destroy.yml
+4
-0
note_spec.rb
spec/models/note_spec.rb
+11
-1
No files found.
app/models/note.rb
View file @
472c2e6a
...
...
@@ -86,6 +86,7 @@ class Note < ActiveRecord::Base
before_validation
:set_discussion_id
after_save
:keep_around_commit
,
unless: :for_personal_snippet?
after_save
:expire_etag_cache
after_destroy
:expire_etag_cache
class
<<
self
def
model_name
...
...
changelogs/unreleased/30457-expire-note-destroy.yml
0 → 100644
View file @
472c2e6a
---
title
:
Fix issue's note cache expiration after delete
merge_request
:
author
:
mhasbini
spec/models/note_spec.rb
View file @
472c2e6a
...
...
@@ -391,12 +391,22 @@ describe Note, models: true do
describe
'expiring ETag cache'
do
let
(
:note
)
{
build
(
:note_on_issue
)
}
it
"expires cache for note's issue when note is saved"
do
def
expect_expiration
(
note
)
expect_any_instance_of
(
Gitlab
::
EtagCaching
::
Store
)
.
to
receive
(
:touch
)
.
with
(
"/
#{
note
.
project
.
namespace
.
to_param
}
/
#{
note
.
project
.
to_param
}
/noteable/issue/
#{
note
.
noteable
.
id
}
/notes"
)
end
it
"expires cache for note's issue when note is saved"
do
expect_expiration
(
note
)
note
.
save!
end
it
"expires cache for note's issue when note is destroyed"
do
expect_expiration
(
note
)
note
.
destroy!
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment