Skip to content

Commit

Permalink
Merge pull request #1331 from neo4jrb/1330_fix
Browse files Browse the repository at this point in the history
1330 fix
  • Loading branch information
cheerfulstoic committed Feb 4, 2017
2 parents 2a70477 + 975dd7a commit a29974b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/neo4j.rb
Expand Up @@ -101,6 +101,8 @@ module Neo4j
autoload :Migration
end

load 'neo4j/tasks/migration.rake'

require 'neo4j/active_node/orm_adapter'
if defined?(Rails)
require 'rails/generators'
Expand Down
4 changes: 0 additions & 4 deletions lib/neo4j/railtie.rb
Expand Up @@ -36,10 +36,6 @@ def empty_config
config.i18n.load_path += Dir[File.join(File.dirname(__FILE__), '..', '..', '..', 'config', 'locales', '*.{rb,yml}')]
end

rake_tasks do
load 'neo4j/tasks/migration.rake'
end

console do
Neo4j::Config[:logger] = ActiveSupport::Logger.new(STDOUT)
end
Expand Down
7 changes: 6 additions & 1 deletion lib/neo4j/tasks/migration.rake
Expand Up @@ -6,7 +6,12 @@ if !defined?(Rails) && !Rake::Task.task_defined?('environment')
task :environment do
require 'neo4j/session_manager'
require 'ostruct'
Neo4j::Railtie.setup!
neo4j_url = ENV['NEO4J_URL'] || 'http://localhost:7474'
$LOAD_PATH.unshift File.dirname('./')
Neo4j::ActiveBase.on_establish_session do
type = neo4j_url =~ /^bolt/ ? :bolt : :http
Neo4j::SessionManager.open_neo4j_session(type, neo4j_url)
end
end
end

Expand Down

0 comments on commit a29974b

Please sign in to comment.