Only repopulate cache on contact destroy if user exists

This commit is contained in:
Dan Hansen & Sarah Mei 2011-11-21 21:39:26 -08:00
parent 0de6512789
commit d9bd25e114

View file

@ -45,7 +45,7 @@ class Contact < ActiveRecord::Base
end
def repopulate_cache!
if RedisCache.configured?
if RedisCache.configured? && self.user.present?
cache = RedisCache.new(self.user)
cache.repopulate!
end