diff options
author | Nick Thomas <nick@gitlab.com> | 2017-04-25 14:46:06 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-04-25 15:22:56 +0100 |
commit | cb1207af36d7c67d6db8e2155ae65b87b009bb36 (patch) | |
tree | 4ee5b15dedf2decc27d1ed2db3442b0753205061 /app/models | |
parent | 04811cbbff15c7b40d679a81f0c920216f873824 (diff) | |
download | gitlab-ce-cb1207af36d7c67d6db8e2155ae65b87b009bb36.tar.gz |
Swap a before_save call with a before_create/before_update pair to avoid a confict with elasticsearch-model
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/cache_markdown_field.rb | 4 |
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 |