Fixes rails/rails#14664