Not sure I like that implementation. It doesn't really make a lot of sense that capturing a farm 4 tiles away from a city captures the city. How would combat work?
If farm is part of the city, then attacking the farm is like attacking the city - so what happens with tactical combat, does it make you fight against the city's walls and troops? After all, if capturing a farm captures the whole city, then the whole city's defenders should be engaged at the farm.