diff --git a/Gemfile b/Gemfile index 251b2af..5febf62 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'http://rubygems.org' -gem 'rails', '3.0.0' +gem 'rails', '~> 3.0.0' -gem 'neo4j', '1.3.1' +gem 'neo4j' gem 'neo4j-admin' # Use unicorn as the web server diff --git a/Gemfile.lock b/Gemfile.lock index 730af1f..563d3d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,80 +2,92 @@ GEM remote: http://rubygems.org/ specs: abstract (1.0.0) - actionmailer (3.0.0) - actionpack (= 3.0.0) - mail (~> 2.2.5) - actionpack (3.0.0) - activemodel (= 3.0.0) - activesupport (= 3.0.0) + actionmailer (3.0.17) + actionpack (= 3.0.17) + mail (~> 2.2.19) + actionpack (3.0.17) + activemodel (= 3.0.17) + activesupport (= 3.0.17) builder (~> 2.1.2) erubis (~> 2.6.6) - i18n (~> 0.4.1) - rack (~> 1.2.1) - rack-mount (~> 0.6.12) - rack-test (~> 0.5.4) + i18n (~> 0.5.0) + rack (~> 1.2.5) + rack-mount (~> 0.6.14) + rack-test (~> 0.5.7) tzinfo (~> 0.3.23) - activemodel (3.0.0) - activesupport (= 3.0.0) + activemodel (3.0.17) + activesupport (= 3.0.17) builder (~> 2.1.2) - i18n (~> 0.4.1) - activerecord (3.0.0) - activemodel (= 3.0.0) - activesupport (= 3.0.0) - arel (~> 1.0.0) + i18n (~> 0.5.0) + activerecord (3.0.17) + activemodel (= 3.0.17) + activesupport (= 3.0.17) + arel (~> 2.0.10) tzinfo (~> 0.3.23) - activeresource (3.0.0) - activemodel (= 3.0.0) - activesupport (= 3.0.0) - activesupport (3.0.0) - arel (1.0.1) - activesupport (~> 3.0.0) + activeresource (3.0.17) + activemodel (= 3.0.17) + activesupport (= 3.0.17) + activesupport (3.0.17) + arel (2.0.10) builder (2.1.2) erubis (2.6.6) abstract (>= 1.0.0) - i18n (0.4.2) - mail (2.2.6.1) + i18n (0.5.0) + json (1.7.5-java) + mail (2.2.19) activesupport (>= 2.3.6) - mime-types - treetop (>= 1.4.5) - mime-types (1.16) - neo4j (1.3.1-java) - activemodel (>= 3.0.0) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.19) + neo4j (2.2.0-java) + activemodel (>= 3.0.0, < 3.3) + neo4j-wrapper (= 2.2.0) orm_adapter (>= 0.0.3) - railties (>= 3.0.0) - will_paginate (= 3.0.pre4) - neo4j-admin (0.0.2-java) - orm_adapter (0.0.5) - polyglot (0.3.1) + railties (>= 3.0.0, < 3.3) + neo4j-admin (0.2.0-java) + neo4j-community (>= 1.8.RC1, < 1.9) + neo4j-community (1.8.RC1-java) + neo4j-core (2.2.0-java) + neo4j-community (>= 1.8.M05, < 1.9) + neo4j-cypher (~> 1.0.0) + neo4j-cypher (1.0.0) + neo4j-wrapper (2.2.0-java) + neo4j-core (= 2.2.0) + orm_adapter (0.4.0) + polyglot (0.3.3) rack (1.2.5) rack-mount (0.6.14) rack (>= 1.0.0) rack-test (0.5.7) rack (>= 1.0) - rails (3.0.0) - actionmailer (= 3.0.0) - actionpack (= 3.0.0) - activerecord (= 3.0.0) - activeresource (= 3.0.0) - activesupport (= 3.0.0) - bundler (~> 1.0.0) - railties (= 3.0.0) - railties (3.0.0) - actionpack (= 3.0.0) - activesupport (= 3.0.0) - rake (>= 0.8.4) - thor (~> 0.14.0) + rails (3.0.17) + actionmailer (= 3.0.17) + actionpack (= 3.0.17) + activerecord (= 3.0.17) + activeresource (= 3.0.17) + activesupport (= 3.0.17) + bundler (~> 1.0) + railties (= 3.0.17) + railties (3.0.17) + actionpack (= 3.0.17) + activesupport (= 3.0.17) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (~> 0.14.4) rake (0.9.2.2) + rdoc (3.12) + json (~> 1.4) thor (0.14.6) - treetop (1.4.8) + treetop (1.4.10) + polyglot polyglot (>= 0.3.1) - tzinfo (0.3.31) - will_paginate (3.0.pre4) + tzinfo (0.3.33) PLATFORMS java DEPENDENCIES - neo4j (= 1.3.1) + neo4j neo4j-admin - rails (= 3.0.0) + rails (~> 3.0.0) diff --git a/README.rdoc b/README.rdoc index 735b79c..a09422c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -7,3 +7,22 @@ Neo4j::Rails::Model object implement most ActiveModel features, making it easy t === Documentation {Documentation}[https://github.com/andreasronge/neo4j/wiki] for Neo4j.rb. + + +== To Run + +rvm use jruby-1.6.7 + +bundle install + +rails s + +open browser at localhost:3000 + +=== neo4j-admin + +Notice that the neo4j-admin gem is included, which make it possible to visualize the graph database. + + Open a browser localhost:7474 + +Notice that the neo4j-admin gem does not work with JRuby 1.7, see https://github.com/andreasronge/neo4j-admin/issues/8 \ No newline at end of file diff --git a/app/models/actor.rb b/app/models/actor.rb index 4bcf37f..d58f16e 100644 --- a/app/models/actor.rb +++ b/app/models/actor.rb @@ -1,6 +1,4 @@ -class Actor < Neo4j::Model - rule(:all) - +class Actor < Neo4j::Rails::Model property :name property :born diff --git a/app/models/movie.rb b/app/models/movie.rb index 2de0948..2564852 100644 --- a/app/models/movie.rb +++ b/app/models/movie.rb @@ -1,6 +1,4 @@ -class Movie < Neo4j::Model - rule(:all) - +class Movie < Neo4j::Rails::Model property :title property :year diff --git a/app/views/movies/show.html.erb b/app/views/movies/show.html.erb index b3929d6..f323e34 100644 --- a/app/views/movies/show.html.erb +++ b/app/views/movies/show.html.erb @@ -17,9 +17,9 @@
<%= link_to role.start_node.name, actor_path(role.start_node) %> as <%= link_to role.as, role_path(r) %> | +<%= link_to role.start_node.name, actor_path(role.start_node) %> as <%= link_to role.as, role_path(role) %> |