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

Doesn't support arbitrary fragments #15

Open
andrewhamon opened this issue Jul 19, 2015 · 1 comment
Open

Doesn't support arbitrary fragments #15

andrewhamon opened this issue Jul 19, 2015 · 1 comment

Comments

@andrewhamon
Copy link

Suppose I have a table nodes with attributes id, parent_id, and name.

It would but much more convenient for the paths to use names instead of ids, at least for my purposes.

Changing the fragment setting breaks most the libraries functionality, mostly due to assumptions on the relationship between fragment and parent_fragment

for example:

def children
  ltree_scope.where(ltree_parent_fragment_column => ltree_fragment)
end

always returns nothing if the fragment setting is changed to name, since we would essentially be querying Node.where(id: "some_string") (and the final query would end up looking like WHERE id = 0 since "some_string".to_i will return 0)

I realize that supporting this would probably require a lot of changes, but I figured it would be worth getting people's thoughts on.

@alibby
Copy link
Contributor

alibby commented Jun 16, 2017

I'm hoping #21 will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants