Commit 9a1ded1f authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'split-out-markdown-cache-update' into 'master'

Split out markdown cache storage into a separate method

See merge request !7277
parents ab17b094 251a20a3
...@@ -46,7 +46,7 @@ module Banzai ...@@ -46,7 +46,7 @@ module Banzai
return html if html.present? return html if html.present?
html = cacheless_render_field(object, field) html = cacheless_render_field(object, field)
object.update_column(html_field, html) unless object.new_record? || object.destroyed? update_object(object, html_field, html) unless object.new_record? || object.destroyed?
html html
end end
...@@ -166,5 +166,9 @@ module Banzai ...@@ -166,5 +166,9 @@ module Banzai
return unless cache_key return unless cache_key
Rails.cache.send(:expanded_key, full_cache_key(cache_key, pipeline_name)) Rails.cache.send(:expanded_key, full_cache_key(cache_key, pipeline_name))
end end
def update_object(object, html_field, html)
object.update_column(html_field, html)
end
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