rails-sqlserver/activerecord-sqlserver-adapter — pull request #172 by nielsjansendk (2012-03-08 16:15:18+00:00)
Title: 3 0 stable

This is fix of the problem in this discussion: http://groups.google.com/group/rails-sqlserver-adapter/browse_thread/thread/e04613db0882f491

I had to do something different than in https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/155

That discussion fixes the problem that an sql-query might have a , (comma) in it. My problem was that an sql query might be longer than "expression direction". The code as it was took only the first word of expression and made the second word the direction, even though something like this: "CASE WHEN ended_on IS NULL THEN 1 ELSE 0 END DESC" is valid sql, where the expression is the entire sentence, and the direction is nil.

I think this problem still remains in the branches for 3.1. and 3.2.

- Niels