Yup, got ants AND flies by doing this as well...I left rotting turnips out and was able to get flies and ants very shortly after dropping the turnip
If only I let them rot intentionally instead of buying 250,000 worth and accidentally going backwards by 30 minutes to reopen my nook shop one day. Oof