Fix for ActiveRecord SQL Server adapter dates Ruby script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: 2140
  • Last update:
  • Platform: Windows / Linux
  • Language: Ruby
  • Price:Freeware
  • Company: timmorgan (View more)

Fix for ActiveRecord SQL Server adapter dates script description:




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

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5