This patch allows Rails to actually work with timestamp columns when using ruby-postgres (http://ruby.scripting.ca/postgres/).
The problem is that when using timestamp with time zone or timestamp without time zone columns, ruby-postgres gives you a DateTime instance.
I've added a new extension inside activesupport/core_ext to DateTime objects so they respond to some of the methods Rails expects (based on the core extensions for Time and Date in activesupport/core_ext).
This way you can call to_time, to_date, xmlschema, etc. on timestamp columns and get correct values.
After applying the patch you will get results like:
>> Case.find(20).started_on.to_time
=> Sun Mar 05 15:18:31 CET 2006
>> Case.find(20).started_on.to_date
=> #<Date: 4907599/2,0,2299161>
>> Case.find(20).started_on.xmlschema
=> "2006-03-05T15:18:31+0100"
instead of the wrong:
>> Case.find(20).started_on.to_time
=> Sun Mar 05 00:00:00 CET 2006
>> Case.find(20).started_on.to_date
=> #<DateTime: 212008328311/86400,1/24,2299161>
>> Case.find(20).started_on.xmlschema
=> "#<DateTime:0x24a5f80>"