Commit ff1e6490 authored by Brett Walker's avatar Brett Walker Committed by Fatih Acet

Don't consider field invalid if updating html also

parent e2e2f0d3
...@@ -179,6 +179,8 @@ module CacheMarkdownField ...@@ -179,6 +179,8 @@ module CacheMarkdownField
define_method(invalidation_method) do define_method(invalidation_method) do
changed_fields = changed_attributes.keys changed_fields = changed_attributes.keys
invalidations = changed_fields & [markdown_field.to_s, *INVALIDATED_BY] invalidations = changed_fields & [markdown_field.to_s, *INVALIDATED_BY]
invalidations.delete(markdown_field.to_s) if changed_fields.include?("#{markdown_field}_html")
!invalidations.empty? || !cached_html_up_to_date?(markdown_field) !invalidations.empty? || !cached_html_up_to_date?(markdown_field)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment