You could replace this loop with: `self.friendships.where(accepted: true, friend_id: potential_friend.id).exists?` [Dat ActiveRecord](http://guides.rubyonrails.org/active_record_querying.html#existence-of-objects)