rails-sqlserver/activerecord-sqlserver-adapter — pull request #188 by dball (2012-04-22 02:05:51+00:00)
Title: This fixes issue 187

The first commit contains an isolated unit test spec for the `quote` and `quoted_datetime` methods in the `Quoting` module, and a failing test case for the `ActiveSupport::TimeWithZone` value. The second contains a fix.

A few things to note:

* There didn't seem to be any unit or integration tests for the quoting behavior, at least explicitly. An isolated unit test like the one I wrote is a bit of a departure from the other tests, but seemed appropriate to the task at hand. That said, if you'd prefer a test which integrates with ActiveRecord's column objects instead of stubs, I'll be happy to revise it, but I may need some help figuring out how to construct them correctly.

* Only the ActiveSupport::TimeWithZone case renders a quoted datetime string with millisecond precision. I personally don't care to track datetimes with sub-second precision, and haven't bothered to explore what level of precision SQL Server claims to support, but it would be easy enough to assert the correct behavior and patch Quoting accordingly if anyone does care.

* It's probable that the quoted_fulliso8601 method would also suffer from this bug. I didn't bother fleshing out the unit tests since I didn't know if this style was going to be accepted, but if it is, I'll see about fleshing it out.