opf/openproject — pull request #7 by linki (2012-12-19 16:30:29+00:00)
Title: Feature/reset sort when clear

this is a mirror + additional code from https://github.com/finnlabs/chiliproject/pull/22

see discussion there for reference.

basically this just removes the duplication which defines the default sort order.

explanation: in order to clear the sort we have to pass in some value for :sort, otherwise it will take it from the session. we could pass ":sort => :clear" which then would end up removing the :sort from the session. This would require more complicated refactoring for a minor reason, therefore I think it's fine to directly pass :sort => [:parent, :desc] when it comes from a single code location.