This should do it: https://github.com/discourse/discourse/commit/421d47da1ed626913810baafe7ed3de7d9bf717b