City buys Ellington Apartments for affordable housing