Commit 6ea26ae6 authored by Douwe Maan's avatar Douwe Maan

Only cache markdown when object has been saved and has a proper cache_key.

parent d60047bb
......@@ -51,7 +51,7 @@ module Mentionable
else
self.class.mentionable_attrs.each do |attr, options|
text = send(attr)
options[:cache_key] = [self, attr] if options.delete(:cache)
options[:cache_key] = [self, attr] if options.delete(:cache) && self.persisted?
ext.analyze(text, options)
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