forked from neoid-gem/neoid
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Less queries when checking for a subref
* Defining neoid_enabled in a Middleware (to make sure Thread.current doesn't leak to next request, see rails/rails#8517) * Model#search renamed to Model#neo_search to not conflict with Sunspot * Return nil if node not found, rather than raising Neography's error * A little bit of cleanup * Better schema management for specs Thanks @lemig for the pull request of the spec fixes
- Loading branch information
Showing
15 changed files
with
144 additions
and
85 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Ndoid | ||
class Middleware | ||
def initialize(app) | ||
@app = app | ||
end | ||
|
||
def call(env) | ||
old, Thread.current[:neoid_enabled] = Thread.current[:neoid_enabled], true | ||
@app.call(env) | ||
ensure | ||
Thread.current[:neoid_enabled] = old | ||
end | ||
end | ||
end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
require 'neoid/middleware' | ||
|
||
module Neoid | ||
class Railtie < Rails::Railtie | ||
initializer "neoid.configure_rails_initialization" do | ||
config.after_initialize do | ||
Neoid.initialize_all | ||
end | ||
end | ||
|
||
initializer 'neoid.inject_middleware' do |app| | ||
app.middleware.use Ndoid::Middleware | ||
end | ||
end | ||
end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Neoid | ||
VERSION = "0.0.41.alpha" | ||
VERSION = "0.0.5.alpha" | ||
end |
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
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
Oops, something went wrong.