{"issue":{"title":"Order by with expressions","created_at":"2011-12-07T17:15:56Z","user":{"login":"jrafanie","id":19339,"url":"https://api.github.com/users/jrafanie","gravatar_id":"9968b786345739e77c49dc09c4f6514c","avatar_url":"https://secure.gravatar.com/avatar/9968b786345739e77c49dc09c4f6514c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"milestone":null,"updated_at":"2011-12-24T00:44:19Z","labels":[],"state":"open","id":2477115,"closed_at":null,"html_url":"https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/155","pull_request":{"patch_url":"https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/155.patch","html_url":"https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/155","diff_url":"https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/155.diff"},"body":"This occurred while using the [ancestry gem](https://github.com/stefankroes/ancestry) which [creates scopes using case expressions](https://github.com/stefankroes/ancestry/blob/master/lib/ancestry/has_ancestry.rb#L54) in an order clause which works fine on postgres but fails on sqlserver due to the custom ordering code.  \r\n\r\nThe second commit contains a failing test that is exacerbated by the fact that the custom ordering code splits on commas without regard for inline functions with parameters.  We're not sure how to fix this particular test without rewriting the entire String conditional of the custom ordering code.\r\n\r\n-- @jrafanie & @fryguy \r\n\r\n","number":155,"url":"https://api.github.com/repos/rails-sqlserver/activerecord-sqlserver-adapter/issues/155","comments":9,"assignee":null},"comment":{"created_at":"2011-12-24T00:44:19Z","user":{"login":"metaskills","id":2381,"url":"https://api.github.com/users/metaskills","gravatar_id":"802f7b7813d7c349a84d444d43cb31ee","avatar_url":"https://secure.gravatar.com/avatar/802f7b7813d7c349a84d444d43cb31ee?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"updated_at":"2011-12-24T00:44:19Z","id":3265872,"body":"Working on the 3.2 adapter now. I will get to this soon, should be in the next few days.","url":"https://api.github.com/repos/rails-sqlserver/activerecord-sqlserver-adapter/issues/comments/3265872"},"action":"created"}