summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-12-16 17:58:14 +0000
committerRobert Speicher <robert@gitlab.com>2015-12-16 17:58:14 +0000
commite27db8694ce982f32a5d74b5911227091edad65a (patch)
tree505ba5c3933ea560f25f46ad1abf375a5563ed77 /app
parentb5230bbe7c9f80ffaa0549cff7dea0d73f4490f8 (diff)
parent6ea26ae62318341a5b352625bf5fdcf1f63ba44c (diff)
downloadgitlab-ce-e27db8694ce982f32a5d74b5911227091edad65a.tar.gz
Merge branch 'reference-cache' into 'master'
Only cache markdown when object has been saved and has a proper cache_key. See merge request !2119
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/mentionable.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb
index d4e3099453d..1fdcda97520 100644
--- a/app/models/concerns/mentionable.rb
+++ b/app/models/concerns/mentionable.rb
@@ -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