]> source.dussan.org Git - redmine.git/commit
Pass the order option as an array to satisfy sqlserver adapter (#12713).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 4 Jan 2013 10:04:25 +0000 (10:04 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 4 Jan 2013 10:04:25 +0000 (10:04 +0000)
commita8083fb9a81d442be19cf3b528f2e4bc5bfe1ba5
treed2e20418b4b487ff973a67e89e4bf9c274aaf4e0
parent0337d9abc3590de73b1c13c932de82afd314709a
Pass the order option as an array to satisfy sqlserver adapter (#12713).

Unlike other adapters, the sqlserver adapter processes the order option and wipes it when using functions.
Here we can see a "ASC" inserted in the COALESCE call:

irb(main):001:0> Issue.order("coalesce(estimated_hours, 0), id").to_sql
=> "SELECT [issues].* FROM [issues] ORDER BY coalesce(estimated_hours ASC, 0) ASC, id ASC"

This does not happen when passing the order SQL fragments separately.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11115 e93f8b46-1217-0410-a6f0-8f06a7374b81
app/helpers/sort_helper.rb
app/models/issue_query.rb
test/unit/helpers/sort_helper_test.rb