Commit e27db869 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'reference-cache' into 'master'

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

See merge request !2119
parents b5230bbe 6ea26ae6
......@@ -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