same as https://github.com/rails/rails/pull/14348/files#r10464486