Fair-Weather Friends

If they aren't there when you needed them, you don't need them ever. If you come to know they're backstabbers and backbiters they don't deserve you as a friend either.

In your case it's pretty evident he/she's just there when they need..