in Hacking

Restart Webrick when mangling constants with Merge! (of course!)

Yesterday I've encountered the irritating date problem in Rails. Please remember to restart Webrick when you change the date conversion constants or time conversion constants with the 'merge!' method:

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(
:default => "%d-%m-%Y"
)

On reload it merges the array again... You can never remove the ':default' date with a merge...
*sigh*

This tip can save you a whole lot of time, because reloading doesn't work