Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #12 from elado/master

Replaced all `delete_node_from_index` calls with `remove_node_from_index` which is the correct Neography method.
  • Loading branch information...
commit 5b3ff9c008a408d2c3110622f4e1b88d51bd3a80 2 parents 3176c15 + 488a365
@lordkada lordkada authored
View
13 Gemfile
@@ -1,16 +1,3 @@
source "http://rubygems.org"
gemspec
-
-#gem 'neography', '0.0.15'
-gem 'neography', '0.0.15', :git => "https://github.com/maxdemarzi/neography.git"
-
-gem 'active_support'
-
-group :test do
- gem "rspec", ">= 2.0.0"
-end
-
-group :development do
- gem "rspec", ">= 2.0.0"
-end
View
4 lib/neology/index_mixin/class_methods.rb
@@ -15,12 +15,12 @@ def index index_name
def delete_node_index(node)
#p "removing index #{_index_name} for #{node["self"]}"
- $neo_server.delete_node_from_index(_index_name, node)
+ $neo_server.remove_node_from_index(_index_name, node)
end
def update_node_index(node, property_name, old_value, new_value)
#p "updating index #{_index_name} for #{node["self"]}: #{property_name} = #{old_value} --> #{new_value}"
- $neo_server.delete_node_from_index(_index_name, property_name, old_value, node)
+ $neo_server.remove_node_from_index(_index_name, property_name, old_value, node)
$neo_server.add_node_to_index(_index_name, property_name, new_value, node)
end
View
2  lib/neology/neo_server.rb
@@ -65,7 +65,7 @@ def add_node_to_index index, key, value, id
@neo_server.add_node_to_index index, key, value, id
end
- def delete_node_from_index *args
+ def remove_node_from_index *args
@neo_server.remove_node_from_index *args
end
View
9 lib/neology/node_mixin/class_methods.rb
@@ -7,9 +7,12 @@ module NodeMixin
module ClassMethods
def new(*args)
-
- graph_node = $neo_server.create_node({ "_classname" => self.name })
- wrapper = self.old_new graph_node
+ if (args.size == 1 and args[0].instance_of? Node)
+ wrapper = self.old_new args[0]
+ else
+ graph_node = $neo_server.create_node({ "_classname" => self.name })
+ wrapper = self.old_new graph_node
+ end
wrapper.init_on_create(*args) if wrapper.respond_to? (:init_on_create)
View
2  lib/neology/node_mixin/node_mixin.rb
@@ -29,7 +29,7 @@ def == (other)
def del
$neo_server.delete_node!(inner_node)
- $neo_server.delete_node_from_index(self.class._index_name, inner_node) if self.class.respond_to? :delete_node_from_index
+ $neo_server.remove_node_from_index(self.class._index_name, inner_node) if self.class.respond_to? :remove_node_from_index
end
def self.included(base)
View
2  lib/neology/utils/rest_utils.rb
@@ -37,7 +37,7 @@ def self.clear_db start_node
$neo_server.delete_node start_node
#p "deleting node #{start_node["self"]}"
p "deleting index #{start_node["data"]["_classname"]+"_index"}"
- $neo_server.delete_node_from_index(start_node["data"]["_classname"]+"_index", start_node)
+ $neo_server.remove_node_from_index(start_node["data"]["_classname"]+"_index", start_node)
end
def self.find_node property, value, start_node_id = 0, max_depth= 1
View
7 neology.gemspec
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_development_dependency "rspec", "~> 2.0.0"
- s.add_dependency 'neography', '0.0.15'
-end
+ s.add_development_dependency "rspec", "~> 2.4.0"
+ s.add_dependency 'neography', '~> 0.0.22'
+ s.add_dependency 'activesupport'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.