neo4j-core 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc288b3293def30d9acf103f70ca43e2d1cfebc9
4
- data.tar.gz: 73225366c230a39f0dff61dd9e6497229251c478
3
+ metadata.gz: 377d0ecb66881b1272a0f620a00aec54f1e39cbe
4
+ data.tar.gz: 16d2716622c955a4409ea043810818ad05d53af1
5
5
  SHA512:
6
- metadata.gz: 8a8ad456a8528cf852f3c8ca451c3853bcd264f182ddd2baf6361318ec8d04fb3a2351b5fd714cc9eba17be197cbc14119faa5021d973dfb2d18a3b7a1c5f054
7
- data.tar.gz: 738ce2b663d3d5fb483ead05725c5bc1a624452bab4341cf3dd2987be0bfab131e4cd68b176c15a23cd148d6309ed253fc33dad51bc7cd22e77554bae2e549cd
6
+ metadata.gz: 0aee2e52eda16ec48962b66ba8e63951d7293bdf4c89e06f8b7a371837d36baa9cc2b06100a6bc827e508a03b74f34b54a47f6b22378f01db8cab95595dcf321
7
+ data.tar.gz: 454be77dc626df324aaa61ad272ba9e666062c0ea9c1becc30f4e0307d11898ed708912cb6fd400e89ceef7218d1f7102cc78647836568e5f38e8a29f43a69ce
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '4.0.3'
3
+ VERSION = '4.0.4'
4
4
  end
5
5
  end
@@ -129,7 +129,8 @@ module Neo4j
129
129
 
130
130
  # (see Neo4j::Node#del)
131
131
  def del
132
- @session._query_or_fail("#{match_start} OPTIONAL MATCH n-[r]-() DELETE n, r", false, neo_id: neo_id)
132
+ query = match_start_query.optional_match('n-[r]-()').delete(:n, :r)
133
+ @session._query_or_fail(query, false)
133
134
  end
134
135
 
135
136
  alias_method :delete, :del
@@ -216,6 +217,10 @@ module Neo4j
216
217
  def match_start(identifier = 'n')
217
218
  "MATCH (#{identifier}) WHERE ID(#{identifier}) = {neo_id}"
218
219
  end
220
+
221
+ def match_start_query(identifier = :n)
222
+ @session.query.match(identifier).where(identifier => {neo_id: neo_id}).with(identifier)
223
+ end
219
224
  end
220
225
  end
221
226
  end
@@ -189,7 +189,13 @@ module Neo4j
189
189
  Neo4j::Transaction.current ? r : r['data']
190
190
  end
191
191
 
192
- def _query_or_fail(q, single_row = false, params = nil)
192
+ def _query_or_fail(q, single_row = false, params = {})
193
+ if q.is_a?(::Neo4j::Core::Query)
194
+ cypher = q.to_cypher
195
+ params = q.send(:merge_params).merge(params)
196
+ q = cypher
197
+ end
198
+
193
199
  response = _query(q, params)
194
200
  response.raise_error if response.error?
195
201
  single_row ? response.first_data : response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Chris Grigg, Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty