diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-11-05 13:06:09 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-15 18:38:31 +0100 |
commit | baac28cbeacc5abaa144e0e0dd546f6e62735373 (patch) | |
tree | 6ad5c4290bbda4683eed4f54aae4e810634a6332 | |
parent | bcee8e00f7f2ca59158ab34b7217044dca764ff0 (diff) | |
download | gitlab-ce-baac28cbeacc5abaa144e0e0dd546f6e62735373.tar.gz |
Merge branch 'split-out-markdown-cache-update' into 'master'
Split out markdown cache storage into a separate method
See merge request !7277
-rw-r--r-- | lib/banzai/renderer.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/banzai/renderer.rb b/lib/banzai/renderer.rb index ce048a36fa0..f31fb6c3f71 100644 --- a/lib/banzai/renderer.rb +++ b/lib/banzai/renderer.rb @@ -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 |