closure_tree
closure_tree copied to clipboard
[question] Is it possible sort hash_tree?
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. (:
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'