Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-primary-key ancestry key #68

Closed
thegcat opened this issue Aug 21, 2011 · 1 comment
Closed

Non-primary-key ancestry key #68

thegcat opened this issue Aug 21, 2011 · 1 comment
Labels

Comments

@thegcat
Copy link

thegcat commented Aug 21, 2011

We're looking into replacements for awesome_nested_set in ChiliProject mainly due to transactional safety concerns and the cost of one update/insert causing multiple writes on large trees, there's 1 thing we'd be missing though, and that's non-primary-key ancestry keys. The use-case would be for wiki pages and using the name of the page as key, so that I can get page nesting based on the path of the wiki page for free.

Example: I have /wiki/some-page and /wiki/some-page/subpage, and I'd get the correct nesting "for free", even better: if I first create /wiki/some-page/subpage and then /wiki/some-page, I'd still get nesting for free.

I'm not sure if we wouldn't need some form of scoping too (all wiki pages live in the same table but belong to different wikis), but I guess that would be easy to solve through named_scopes or similar.

Anyway, would you consider non-primary-key ancestry keys?

@kbrock
Copy link
Collaborator

kbrock commented Apr 9, 2023

There is an example in the hook tests for having a breadcrumb like ancestry tree.

Ancestry still uses primary keys, but this should meet your needs.

@kbrock kbrock closed this as completed Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants