See https://github.com/rails/rails/commit/5757fe476a126d4f7de2791da5af0e6aeef0d1e6