summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2016-11-03 19:17:42 +0000
committerNick Thomas <nick@gitlab.com>2016-11-04 04:00:14 +0000
commit251a20a30df6321191122f1d332f29757a2fc735 (patch)
treeaa3c494023954c6a4c300835b663110527c45c9d
parent3a8a7c1251cef4098ffbc54718ba21736c5e2800 (diff)
downloadgitlab-ce-251a20a30df6321191122f1d332f29757a2fc735.tar.gz
Split out markdown cache storage into a separate method
-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