I'm currently working through this tutorial and I'm stuck when it comes to creating relationships in the rails console. I've read through the Neo4jrb project documentation and a blog post on jayway.com but still can't figure it out.
I've created a rails site and I want to create team nodes, league nodes, and relationships between them in a Neo4j database using my rails scripts. I have two models:
One for League
class Team
include Neo4j::ActiveNode
property :name, type: String
has_one :out, :league, type: :PLAY_IN
end
One for Team
class League
include Neo4j::ActiveNode
property :name, type: String
property :rank, type: Integer
has_many :in, :teams, origin: :league
end
Using the rails console, I can create a node using this code:
League.create(name: "League 2")
Using the console, how do I create a relationship between two nodes as defined in my models?
Here is my code in github. Thanks in advance!
** Edit **
Removed: model_class