closure_tree icon indicating copy to clipboard operation
closure_tree copied to clipboard

[question] Is it possible sort hash_tree?

Open wbotelhos opened this issue 8 years ago • 1 comments

I'm using hash_tree so build a comment tree where each comment has more or less likes. I would like to sort the tree to put the comment with more like on top, but always inside each parent.

A parent comment with poor like will be keep above, even when its children has good rating. Just because I would like to sort from the root until the deeper one.

Any way to arquive it? Thanks for this great gem. (:

wbotelhos avatar Jan 09 '18 05:01 wbotelhos

I tried to look up into code, but there is no possibility to pass the order direction or more than one order. I would like to do that:

has_closure_tree order: 'rating desc, created_at desc'

wbotelhos avatar Jan 24 '18 03:01 wbotelhos