Skip to content

Preorder traversal sequence on descendants #38

Closed
@elhoyos

Description

@elhoyos

I believe this can be a very particular feature, but do you have any thoughts on making tag.descendants return its results with a preorder sequence? What would you recommend?

grandparent = Tag.find_or_create_by_path(["grandparent", "parentA", "childA"]).parent.parent
Tag.find_or_create_by_path(["grandparent", "parentB", "childB"])
grandparent.descendants
=> ["parentA", "parentB", "childA", "childB"] # current traversal sequence
=> ["parentA", "childA", "parentB", "childB"] # preorder traversal sequence 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions