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

This commit is contained in:
Douwe Maan
2015-12-16 18:36:14 +01:00
parent d60047bb31
commit 6ea26ae623
+1 -1
View File
@@ -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