Split out markdown cache storage into a separate method
This commit is contained in:
parent
3a8a7c1251
commit
251a20a30d
1 changed files with 5 additions and 1 deletions
|
@ -46,7 +46,7 @@ module Banzai
|
|||
return html if html.present?
|
||||
|
||||
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
|
||||
end
|
||||
|
@ -166,5 +166,9 @@ module Banzai
|
|||
return unless cache_key
|
||||
Rails.cache.send(:expanded_key, full_cache_key(cache_key, pipeline_name))
|
||||
end
|
||||
|
||||
def update_object(object, html_field, html)
|
||||
object.update_column(html_field, html)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue