Publisher review:Fix for ActiveRecord SQL Server adapter dates - The SQL Server adapter for ActiveRecord uses Time objects to cast dates from the db. The SQL Server adapter for ActiveRecord uses Time objects to cast dates from the db. This fails for dates before 1970, thus some birthdates come back as nil. This is some kludge to use a DateTime in that case so we still get the value.A better approach may be to convert this code to use DateTime objects exclusively, but I'm not sure of the speed implications of doing so. The code below first tries to cast the value to a Time object; if that fails, it tries a DateTime object; if that fails, it returns nil.Stick this in a plugin to use with Rails.
Fix for ActiveRecord SQL Server adapter dates is a Ruby script for Snippets scripts design by timmorgan.
It runs on following operating system: Windows / Linux.
Operating system:Windows / Linux