Created
September 30, 2014 00:15
-
-
Save subvertallchris/c0bff2f4e0e544e412fe to your computer and use it in GitHub Desktop.
movies models?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Movie | |
include Neo4j::ActiveNode | |
id_property :title | |
has_many :in, :actors, model_class: :Person, rel_class: Engagement | |
end | |
class Engagement | |
include Neo4j::ActiveRel | |
from_class Person | |
to_class Movie | |
type 'ACTED_IN' | |
property :roles | |
end | |
class Person | |
include Neo4j::ActiveNode | |
id_property :name | |
has_many :out, :acted_in, model_class: :Movie, rel_class: Engagement | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment