Swap a before_save call with a before_create/before_update pair to avoid a confict with elasticsearch-model

This commit is contained in:
Nick Thomas 2017-04-25 14:46:06 +01:00
parent 04811cbbff
commit cb1207af36
1 changed files with 3 additions and 1 deletions

View File

@ -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