Menu

Commit [r11115]  Maximize  Restore  History

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.

jplang 2013-01-04

changed /trunk/app/helpers/sort_helper.rb
changed /trunk/app/models/issue_query.rb
changed /trunk/test/unit/helpers/sort_helper_test.rb
/trunk/app/helpers/sort_helper.rb Diff Switch to side-by-side view
Loading...
/trunk/app/models/issue_query.rb Diff Switch to side-by-side view
Loading...
/trunk/test/unit/helpers/sort_helper_test.rb Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.