Skip to content

Commit

Permalink
Made it work with neo4j 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasronge committed Oct 2, 2012
1 parent 74d748e commit a19da8d
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 63 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
118 changes: 65 additions & 53 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
19 changes: 19 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions app/models/actor.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class Actor < Neo4j::Model
rule(:all)

class Actor < Neo4j::Rails::Model
property :name
property :born

Expand Down
4 changes: 1 addition & 3 deletions app/models/movie.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class Movie < Neo4j::Model
rule(:all)

class Movie < Neo4j::Rails::Model
property :title
property :year

Expand Down
4 changes: 2 additions & 2 deletions app/views/movies/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

<h3>Actors</h3>
<table>
<% @movie.actors_rels.each do |r| %>
<% @movie.actors_rels.each do |role| %>
<tr>
<td><%= link_to role.start_node.name, actor_path(role.start_node) %> as <%= link_to role.as, role_path(r) %></td>
<td><%= link_to role.start_node.name, actor_path(role.start_node) %> as <%= link_to role.as, role_path(role) %></td>
</tr>
<% end %>
</table>
Expand Down

0 comments on commit a19da8d

Please sign in to comment.