Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 12 files changed
  • 0 commit comments
  • 1 contributor
View
1  .gitignore
@@ -1,3 +1,4 @@
+.idea/*
.autotest
log/*
tmp/*
View
1  .rvmrc
@@ -0,0 +1 @@
+rvm jruby-1.5.5
View
5 Gemfile
@@ -1,6 +1,5 @@
source 'http://rubygems.org'
gem 'rails', '3.0.3'
-gem 'sqlite3-ruby', :require => 'sqlite3'
-
-gem 'devise', '1.1.4'
+gem 'neo4j', '1.0.0.beta.23' #:path => '/home/andreas/projects/neo4j'
+gem 'devise-neo4j', :git => 'git://github.com/benjackson/devise-neo4j.git'
View
32 Gemfile.lock
@@ -1,3 +1,11 @@
+GIT
+ remote: git://github.com/benjackson/devise-neo4j.git
+ revision: ea93317a4b24c00a6a5ea53064d4d6636ce5022d
+ specs:
+ devise-neo4j (0.1.0)
+ devise (>= 1.2.rc)
+ neo4j
+
GEM
remote: http://rubygems.org/
specs:
@@ -28,21 +36,28 @@ GEM
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activesupport (3.0.3)
- arel (2.0.4)
+ arel (2.0.6)
bcrypt-ruby (2.1.2)
builder (2.1.2)
- devise (1.1.4)
+ devise (1.2.rc)
bcrypt-ruby (~> 2.1.2)
+ orm_adapter (~> 0.0.2)
warden (~> 1.0.2)
erubis (2.6.6)
abstract (>= 1.0.0)
- i18n (0.4.2)
- mail (2.2.10)
+ i18n (0.5.0)
+ mail (2.2.12)
activesupport (>= 2.3.6)
- i18n (~> 0.4.1)
+ i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
+ neo4j (1.0.0.beta.23-java)
+ activemodel (>= 3.0.0)
+ orm_adapter (>= 0.0.3)
+ railties (>= 3.0.0)
+ will_paginate (~> 3.0.pre)
+ orm_adapter (0.0.3)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
@@ -63,18 +78,19 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
- sqlite3-ruby (1.3.2)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
warden (1.0.2)
rack (>= 1.0.0)
+ will_paginate (3.0.pre2)
PLATFORMS
+ java
ruby
DEPENDENCIES
- devise (= 1.1.4)
+ devise-neo4j!
+ neo4j (= 1.0.0.beta.23)
rails (= 3.0.3)
- sqlite3-ruby
View
18 README.rdoc
@@ -4,6 +4,8 @@ Example App using devise. http://github.com/plataformatec/devise
== Installation
+Install JRuby, I recommend using RVM.
+
Install bundler if you haven't yet:
gem install bundler
@@ -12,20 +14,10 @@ Install the gems:
bundle install
-This will install Rails 3, sqlite3-ruby gem and Devise 1.1.2.
-
-Rake devise setup task:
-
- rake devise:setup
-
-This will:
-
-* drop any existing database
-* create a new database
-* migrate the database
-* create a default user and admin
+This will install Rails 3, neo4j and Devise 1.1.2.
+Start the server:
-Run the server and use the credentials provided by the rake task to sign in and test the application.
+ rails s
== License
View
2  app/models/admin.rb
@@ -1,4 +1,4 @@
-class Admin < ActiveRecord::Base
+class Admin < Neo4j::Model
devise :database_authenticatable, :registerable, :timeoutable, :validatable,
:timeout_in => 20.minutes
end
View
9 app/models/user.rb
@@ -1,7 +1,14 @@
-class User < ActiveRecord::Base
+class User < Neo4j::Model
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:rememberable, :registerable, :trackable, :timeoutable, :validatable,
:token_authenticatable
attr_accessible :email, :password, :password_confirmation
+
+ property :name
+ property :email
+ property :password
+
+ index :email
+ index :name
end
View
30 config/application.rb
@@ -1,6 +1,24 @@
require File.expand_path('../boot', __FILE__)
-require 'rails/all'
+#require 'rails/all'
+
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "active_resource/railtie"
+require "rails/test_unit/railtie"
+require 'neo4j'
+require 'devise-neo4j'
+#require 'devise-neo4j/devise/orm/neo4j'
+
+# this should be included in the devise-neo4j gem, we do it here instead:
+module Neo4j
+ module Rails
+ class Model
+ extend ::Devise::Models
+ extend ::Devise::Orm::Neo4j::Hook
+ end
+ end
+end
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
@@ -38,5 +56,15 @@ class Application < Rails::Application
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
+
+ # Enable Neo4j generators, e.g: rails generate model Admin --parent User
+ config.generators do |g|
+ g.orm :neo4j
+ g.test_framework :rspec, :fixture => false
+ end
+
+ # Configure where the neo4j database should exist
+ config.neo4j.storage_path = "#{config.root}/db/neo4j-#{Rails.env}"
+
end
end
View
17 db/migrate/20090916131255_create_users.rb
@@ -1,17 +0,0 @@
-class CreateUsers < ActiveRecord::Migration
- def self.up
- create_table :users do |t|
- t.authenticatable
- t.confirmable
- t.recoverable
- t.rememberable
- t.trackable
- t.lockable
- t.timestamps
- end
- end
-
- def self.down
- drop_table :users
- end
-end
View
12 db/migrate/20091009223419_create_admins.rb
@@ -1,12 +0,0 @@
-class CreateAdmins < ActiveRecord::Migration
- def self.up
- create_table :admins do |t|
- t.authenticatable
- t.timestamps
- end
- end
-
- def self.down
- drop_table :admins
- end
-end
View
12 db/migrate/20100615195947_token_authentication.rb
@@ -1,12 +0,0 @@
-class TokenAuthentication < ActiveRecord::Migration
- def self.up
- add_column :users, :authentication_token, :string
- User.find_each do |u|
- u.ensure_authentication_token!
- end
- end
-
- def self.down
- remove_column :users, :authentication_token, :string
- end
-end
View
46 db/schema.rb
@@ -1,46 +0,0 @@
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20100615195947) do
-
- create_table "admins", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
- t.string "password_salt", :default => "", :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- create_table "users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
- t.string "password_salt", :default => "", :null => false
- t.string "confirmation_token"
- t.datetime "confirmed_at"
- t.datetime "confirmation_sent_at"
- t.string "reset_password_token"
- t.string "remember_token"
- t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
- t.datetime "current_sign_in_at"
- t.datetime "last_sign_in_at"
- t.string "current_sign_in_ip"
- t.string "last_sign_in_ip"
- t.integer "failed_attempts", :default => 0
- t.string "unlock_token"
- t.datetime "locked_at"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "authentication_token"
- end
-
-end

No commit comments for this range

Something went wrong with that request. Please try again.