summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-11-05 13:06:09 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-11-05 13:06:09 +0000
commit9a1ded1fe6bb615a9b92b7b463d099700245cf98 (patch)
tree6990f3efb6449b3e84df4e123dee8283bd14ff59
parentab17b0948734f9af63d5767088c085da0424f6c4 (diff)
parent251a20a30df6321191122f1d332f29757a2fc735 (diff)
downloadgitlab-ce-9a1ded1fe6bb615a9b92b7b463d099700245cf98.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.rb6
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