#64 ✓resolved
jho406 (at gmail)

Child classes should have a relationship of their own.

Reported by jho406 (at gmail) | August 6th, 2009 @ 03:30 AM | in 0.3.3

In addition to the "root_class" relationship, I think child classes should have a relationship of its' own from the index node. This way the reindexer "all" method can be changed such that it would return all nodes of the corresponding "class" rather than "root_class"

So in this example from the documentation:

  require 'neo4j/extensions/reindexer'

  class Car
    include Neo4j::Node
    property :wheels
  end

  class Volvo < Car
  end

  v = Volvo.new
  c = Car.new

  Car.all   # will return all relationships from the index node to car objects
  Volvo.all # will return the same as Car.all

  Car.all.nodes    # => [c,v]
  Volvo.all.nodes  # => [c,v]

I thought that it would make more sense if this happened:

  Volvo.all.nodes  # => [v]

thanks!
j

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket

Referenced by

Pages