rails-sqlserver/activerecord-sqlserver-adapter — pull request #248 by subakva (2013-01-14 19:01:40+00:00)
Title: Bugs/product version check 247

This fixes issue #247.

I tried to make this change without impacting the current behavior too much, but there are some implicit assumptions about the version number being a year in the adapter. Azure SQL doesn't technically have a year in the product name or the version, which makes the result of ```database_year``` and ```sqlserver_2012?``` somewhat ambiguous.

A few notes:

* ```database_year``` will continue to return the build year for SQL Azure. This value is actually the build year and not the year from the product name, so it's not clear whether this is correct. I considered having it return nil for an Azure connection, but that would be a breaking change for anyone who is depending on ```database_year >= 2008``` to switch behavior.
* Since the ```database_year``` for Azure SQL is now 2013, ```sqlserver_2012?``` will now return false for SQL Azure. This is technically correct, but it may be surprising, since SQL Azure acts somewhat like SQL Server 2012.
* I don't have access to any SQL Server versions other that Azure, so I wasn't able to test this change on any version other than the current SQL Azure.
* I added some isolated unit tests for the version check, but the suite won't run without an instance of SQL Server (which I don't have), so I wasn't able to run them :-/.
* My editor strips trailing whitespace. If that's an issue, I can update the branch.