summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-04-25 14:46:06 +0100
committerNick Thomas <nick@gitlab.com>2017-04-25 15:22:56 +0100
commitcb1207af36d7c67d6db8e2155ae65b87b009bb36 (patch)
tree4ee5b15dedf2decc27d1ed2db3442b0753205061
parent04811cbbff15c7b40d679a81f0c920216f873824 (diff)
downloadgitlab-ce-cb1207af36d7c67d6db8e2155ae65b87b009bb36.tar.gz
Swap a before_save call with a before_create/before_update pair to avoid a confict with elasticsearch-model
-rw-r--r--app/models/concerns/cache_markdown_field.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb
index 2eedc143968..f033028c4e5 100644
--- a/app/models/concerns/cache_markdown_field.rb
+++ b/app/models/concerns/cache_markdown_field.rb
@@ -120,7 +120,9 @@ module CacheMarkdownField
attrs
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
class_methods do