# HG changeset patch # User bsw # Date 1359826949 -3600 # Node ID fc8ae2b4c2c6c1c29ab42fd1b72d4fd20ad83fd1 # Parent f9f3b3edb1217ffc21f26f42cabb4f74d509d106 Initiatives without harmonic weight sorted last diff -r f9f3b3edb121 -r fc8ae2b4c2c6 app/main/event/_list.lua --- a/app/main/event/_list.lua Sat Feb 02 18:17:34 2013 +0100 +++ b/app/main/event/_list.lua Sat Feb 02 18:42:29 2013 +0100 @@ -166,7 +166,7 @@ if not event.initiative_id then local initiatives_selector = Initiative:new_selector() :add_where{ "initiative.issue_id = ?", event.issue_id } - :add_order_by("initiative.rank, initiative.harmonic_weight DESC, id") + :add_order_by("initiative.rank, initiative.harmonic_weight DESC NULLS LAST, id") execute.view{ module = "initiative", view = "_list", params = { issue = event.issue, initiatives_selector = initiatives_selector, diff -r f9f3b3edb121 -r fc8ae2b4c2c6 model/issue.lua --- a/model/issue.lua Sat Feb 02 18:17:34 2013 +0100 +++ b/model/issue.lua Sat Feb 02 18:42:29 2013 +0100 @@ -37,7 +37,7 @@ that_key = 'issue_id', ref = 'initiatives', back_ref = 'issue', - default_order = 'initiative.rank, initiative.harmonic_weight DESC, id' + default_order = 'initiative.rank, initiative.harmonic_weight DESC NULLS LAST, id' } Issue:add_reference{