Added block to sort_by_ancestry method for sorting within rank. #85

Closed
wants to merge 2 commits into
from

Projects

None yet

10 participants

@iliya-gr

Hi! I added block to sort_by_ancestry for custom sorting.
Example: Node.sort_by_ancestry(Node.all) {|a, b| a.position <=> b.position}

@ncolgan

+1

@phallstrom

+1. This just bit me today where results were being returned in different orders. Some googling turns up that quick sort (what sort_by) uses isn't stable and may very well swap the position of elements with the same value for the sorted key. Yuck :/

@zapnap

+1 would love to see this merged into master

@sunny

+1

@niklas

+1

@StefanH StefanH pushed a commit that referenced this pull request May 7, 2013
Stefan Henzen added test for #85 39e2268
@StefanH
Collaborator

Merged & closed by 39e2268

@StefanH StefanH closed this May 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment