Only repopulate cache on contact destroy if user exists
This commit is contained in:
parent
0de6512789
commit
d9bd25e114
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue