Our application previously defined the default date format as DD/MM/YYYY in config/application.rb like so:
Date::DATE_FORMATS[:default] = '%d/%m/%Y'
This worked as expected in Rails 6.1, but after upgrading to Rails 7.0 it now appears to be ignored by .to_s:
Loading development environment (Rails 7.0.2.2)
3.0.1 :001 > Date::DATE_FORMATS[:default]
=> "%d/%m/%Y"
3.0.1 :002 > Date.new(2022, 12, 31).to_s
=> "2022-12-31"
3.0.1 :003 > Date.new(2022, 12, 31).to_fs
=> "31/12/2022"
How can I have .to_s implement this behaviour in Rails 7.0+?