#184 new
Andreas Ronge

Inheritance for Neo4j::Rails::Model does not work in Rails

Reported by Andreas Ronge | September 22nd, 2011 @ 02:08 PM

Setting a relationship on a model that inherits from another model
causes an exception.
For example:

class BizProcess < Neo4j::Rails::Model 
 property :title, :type => String 
end 

class Innovation < BizProcess 
 has_n(:deps).to(Department) 
end 

class Department < Neo4j::Rails::Model 
  property :name, :type => String 
  index :name 
  has_n(:innovations).from(Innovation, :deps) 
end

Then when typing 'Innovation' in rails console:

Innovation 
LoadError: Expected /app/models/innovation.rb to define Innovation

In the stack trace down the line it points to the issue being the line
in the Department model that defines the relationship.
When setting Innovation to inherit from Neo4j::Rails::Model, the
problem goes away, but that's not an acceptable solution.
One workaround I've used it defining it in the BizProcess model, but
this is confusing to others.

See also: http://groups.google.com/group/neo4jrb/browse_thread/thread/8de92e3...#

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

Pages