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
c7df9771
Commit
c7df9771
authored
Apr 26, 2017
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'backport-md-cache-fix' into 'master'
Work around a hard-to-understand failure in `CacheMarkdownField` See merge request !10918
parents
465a8180
0e24b128
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
cache_markdown_field.rb
app/models/concerns/cache_markdown_field.rb
+3
-1
cache_markdown_field_spec.rb
spec/models/concerns/cache_markdown_field_spec.rb
+2
-2
No files found.
app/models/concerns/cache_markdown_field.rb
View file @
c7df9771
...
@@ -120,7 +120,9 @@ module CacheMarkdownField
...
@@ -120,7 +120,9 @@ module CacheMarkdownField
attrs
attrs
end
end
before_save
:refresh_markdown_cache!
,
if: :invalidated_markdown_cache?
# Using before_update here conflicts with elasticsearch-model somehow
before_create
:refresh_markdown_cache!
,
if: :invalidated_markdown_cache?
before_update
:refresh_markdown_cache!
,
if: :invalidated_markdown_cache?
end
end
class_methods
do
class_methods
do
...
...
spec/models/concerns/cache_markdown_field_spec.rb
View file @
c7df9771
...
@@ -18,7 +18,7 @@ describe CacheMarkdownField do
...
@@ -18,7 +18,7 @@ describe CacheMarkdownField do
end
end
extend
ActiveModel
::
Callbacks
extend
ActiveModel
::
Callbacks
define_model_callbacks
:
sav
e
define_model_callbacks
:
create
,
:updat
e
include
CacheMarkdownField
include
CacheMarkdownField
cache_markdown_field
:foo
cache_markdown_field
:foo
...
@@ -56,7 +56,7 @@ describe CacheMarkdownField do
...
@@ -56,7 +56,7 @@ describe CacheMarkdownField do
end
end
def
save
def
save
run_callbacks
:
sav
e
do
run_callbacks
:
updat
e
do
changes_applied
changes_applied
end
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