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

Change automatic label names when class is within a module? #753

Closed
subvertallchris opened this issue Apr 11, 2015 · 3 comments
Closed

Change automatic label names when class is within a module? #753

subvertallchris opened this issue Apr 11, 2015 · 3 comments

Comments

@subvertallchris
Copy link
Contributor

As pointed out by @smackesey, quoting from Gitter:

"if I have this code:

module Animals
  class Sheep
    include Neo4j::ActiveNode
  end
end

then the label used to label Sheep is Animals::Sheep, and then this Cypher clause is invalid:

MATCH(n:Animals::Sheep)

and you have to do this instead:

MATCH(n:`Animals::Sheep`)

I think it would be better to use Animals_Sheep or something"

mapped_label_name can be used to work around it for now but it's worth exploring.

@cheerfulstoic
Copy link
Contributor

My comment from Gitter

"it’s a good point. Though if we replace them with something else it becomes easier to type, but it also becomes a piece of magic that users need to know about"

There was also discussion about using just Sheep as the label, though my gut says that namespaces exist for a reason and this will lead to conflicts. Maybe a _ruby_namespace or something? Maybe indexing would be an issue?

@subvertallchris
Copy link
Contributor Author

One vote here for a configurable option. I'd like the ability to ignore or possibly transform module names during load.

If we want to make a change, I'm happy to work on it over the weekend or early next week.

@cheerfulstoic
Copy link
Contributor

I'm down with a configurable option. Maybe default to "none" (for current behavior) and "without_modules" for proposed behavior, with the ability to specify a #callable object which takes/returns a string.

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