neo4j 8.0.7 → 8.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/neo4j/active_node/query/query_proxy_methods.rb +6 -3
- data/lib/neo4j/active_node/query_methods.rb +5 -2
- data/lib/neo4j/version.rb +1 -1
- metadata +5 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4e4e1f41a10a75f45e91874eafeafce3bdab8c7
|
4
|
+
data.tar.gz: 67f98d425120d37961028c8ca3f548cd56eda227
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33842d045636bfcfe4592157d9d634841346c8a02d22ebd3312549d97a767365d6ea645ad58cc4820a6316b85a74d85ae040703f5e07c476b787f46039377c73
|
7
|
+
data.tar.gz: 60f12d641a8c464b1a075075b2d7adf6d595ab1d4d1b6d25d53339c35f3ba0f87f702508ba49672e8104baf0cc9744d51dfa2931b56e823780864f6f571c5e4e
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This file should follow the standards specified on [http://keepachangelog.com/]
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [8.0.8] 2016-02-27
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- Performance and response consistency improvements to `exists?` methods
|
11
|
+
|
6
12
|
## [8.0.7] 2016-02-24
|
7
13
|
|
8
14
|
### Fixed
|
@@ -94,12 +94,13 @@ module Neo4j
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def exists?(node_condition = nil, target = nil)
|
97
|
-
unless
|
98
|
-
fail(Neo4j::InvalidParameterError, ':exists? only accepts
|
97
|
+
unless [Integer, Fixnum, String, Hash, NilClass].include?(node_condition.class)
|
98
|
+
fail(Neo4j::InvalidParameterError, ':exists? only accepts ids or conditions')
|
99
99
|
end
|
100
100
|
query_with_target(target) do |var|
|
101
101
|
start_q = exists_query_start(node_condition, var)
|
102
|
-
start_q.query.reorder.return("
|
102
|
+
result = start_q.query.reorder.return("ID(#{var}) AS proof_of_life LIMIT 1").first
|
103
|
+
!!result
|
103
104
|
end
|
104
105
|
end
|
105
106
|
|
@@ -284,6 +285,8 @@ module Neo4j
|
|
284
285
|
self.where("ID(#{target}) = {exists_condition}").params(exists_condition: condition)
|
285
286
|
when Hash
|
286
287
|
self.where(condition.keys.first => condition.values.first)
|
288
|
+
when String
|
289
|
+
self.where(model.primary_key => condition)
|
287
290
|
else
|
288
291
|
self
|
289
292
|
end
|
@@ -2,12 +2,13 @@ module Neo4j
|
|
2
2
|
module ActiveNode
|
3
3
|
module QueryMethods
|
4
4
|
def exists?(node_condition = nil)
|
5
|
-
unless
|
5
|
+
unless [Integer, Fixnum, String, Hash, NilClass].include?(node_condition.class)
|
6
6
|
fail(Neo4j::InvalidParameterError, ':exists? only accepts ids or conditions')
|
7
7
|
end
|
8
8
|
query_start = exists_query_start(node_condition)
|
9
9
|
start_q = query_start.respond_to?(:query_as) ? query_start.query_as(:n) : query_start
|
10
|
-
start_q.return('
|
10
|
+
result = start_q.return('ID(n) AS proof_of_life LIMIT 1').first
|
11
|
+
!!result
|
11
12
|
end
|
12
13
|
|
13
14
|
# Returns the first node of this class, sorted by ID. Note that this may not be the first node created since Neo4j recycles IDs.
|
@@ -54,6 +55,8 @@ module Neo4j
|
|
54
55
|
case node_condition
|
55
56
|
when Integer
|
56
57
|
self.query_as(:n).where('ID(n)' => node_condition)
|
58
|
+
when String
|
59
|
+
self.query_as(:n).where(n: {primary_key => node_condition})
|
57
60
|
when Hash
|
58
61
|
self.where(node_condition.keys.first => node_condition.values.first)
|
59
62
|
else
|
data/lib/neo4j/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.
|
4
|
+
version: 8.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Brian Underwood, Chris Grigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|
@@ -210,10 +210,8 @@ dependencies:
|
|
210
210
|
- - "~>"
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: 0.39.0
|
213
|
-
description:
|
214
|
-
frameworks heavily inspired by ActiveRecord.
|
215
|
-
|
216
|
-
'
|
213
|
+
description: |
|
214
|
+
A Neo4j OGM (Object-Graph-Mapper) for use in Ruby on Rails and Rack frameworks heavily inspired by ActiveRecord.
|
217
215
|
email: andreas.ronge@gmail.com, public@brian-underwood.codes, chris@subvertallmedia.com
|
218
216
|
executables:
|
219
217
|
- neo4j-jars
|
@@ -367,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
367
365
|
version: '0'
|
368
366
|
requirements: []
|
369
367
|
rubyforge_project: neo4j
|
370
|
-
rubygems_version: 2.
|
368
|
+
rubygems_version: 2.4.5.1
|
371
369
|
signing_key:
|
372
370
|
specification_version: 4
|
373
371
|
summary: A graph database for Ruby
|