diff --git a/app/sweepers/friendship_sweeper.rb b/app/sweepers/friendship_sweeper.rb index c165da7..39a1c62 100644 --- a/app/sweepers/friendship_sweeper.rb +++ b/app/sweepers/friendship_sweeper.rb @@ -13,8 +13,11 @@ class FriendshipSweeper < ActiveRecord::Observer protected def expire_caches(friendship) - expire_cache(friendship.person) - expire_cache(friendship.friend) + [friendship.person, friendship.friend].each do |profile| + if profile + expire_cache(profile) + end + end end def expire_cache(profile) -- libgit2 0.21.2