Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2090246a57
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (28 sloc) 0.648 kb
class Movie; end
class Role
include Neo4j::RelationshipMixin
property :title, :character
def to_s
"Role title #{self.title} character #{self.character}"
end
end
class Actor
include Neo4j::NodeMixin
property :name
has_n(:acted_in).to(Movie).relationship(Role)
index :name, :tokenized => true
def to_s
"Actor #{self.name}"
end
end
class Movie
include Neo4j::NodeMixin
property :title
property :year
index :title, :tokenized => true
# defines a method for traversing incoming acted_in relationships from Actor
has_n(:actors).from(Actor, :acted_in)
def to_s
"Movie #{self.title}"
end
end
Jump to Line
Something went wrong with that request. Please try again.