-
Notifications
You must be signed in to change notification settings - Fork 274
Neo4j.rb v3 Inheritance
Chris Grigg edited this page Aug 6, 2014
·
4 revisions
Index, properties and declared relationships (has_many
and has_one
) are inherited.
Example:
class Vehicle
include Neo4j::ActiveNode
property :name, type: String
index :name
end
class Car < Vehicle
property :model
index :model
end
bike = Vehicle.create(name: 'bike')
volvo = Car.create(name: 'volvo', model: 'v60')
saab = Car.create(name: 'saab', model: '900')
Car.find(name: 'volvo') # => volvo
Vehicle.find(name: 'volvo') # => volvo
Car.find(model: '900') # => saab
Vehicle.find(model: '900') # => saab
WARNING: Much of the information in this wiki is out of date. We are in the process of moving things to readthedocs
- Project Introduction
- Neo4j::ActiveNode
- Neo4j::ActiveRel
- Search and Scope
- Validation, Uniqueness, and Case Sensitivity
- Indexing VS Legacy Indexing
- Optimized Methods
- Inheritance
- Core: Nodes & Rels
- Introduction
- Persistence
- Find : Lucene
- Relationships
- Third Party Gems & extensions
- Scaffolding & Generators
- HA Cluster