neo4j 8.1.2 → 8.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/neo4j/active_node/labels.rb +1 -0
- data/lib/neo4j/active_node/query/query_proxy_enumerable.rb +21 -13
- data/lib/neo4j/shared/type_converters.rb +5 -1
- data/lib/neo4j/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b73745139ccf41ae025891a9c0ff69c57cd94aeb
|
4
|
+
data.tar.gz: 6826e2a3b7abeef95527550178e854ebbdf4ecf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13e0a756de72ad02f82b1526f84599d7cf47eaf20fbf842da11e008e09f1f231e01045bd1a2cba64c1a9cbbe7cf44a9fe8253f435730bef73545aed71af71c70
|
7
|
+
data.tar.gz: 0d2e7ffd847bb2c16389226f3ee9f8338f9eded404053fa8414f610901562bc916fc11b12f9260e6b14884cf5ab120e34331d3c9b98291dc6340342f098b1efb
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@ 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.1.3] 2017-06-29
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- `ActiveRel` `.first` / `.last` aren't dependable for ordering in Neo4j enterprise, so fixed test (be aware that using `.first` / `.last` are not recommended in `ActiveRel`) (see #1396 / thanks @klobuczek)
|
11
|
+
- Labels for models are now returned alphabetically (see #1396 / thanks @klobuczek)
|
12
|
+
- JSON serialization is fixed for `String` and objects in general which respond to `to_json` (see #1397 / thanks @leviwilson)
|
13
|
+
|
6
14
|
## [8.1.2] 2017-06-20
|
7
15
|
|
8
16
|
### Fixed
|
@@ -72,6 +72,7 @@ module Neo4j
|
|
72
72
|
# Finds an appropriate matching model given a set of labels
|
73
73
|
# which are assigned to a node
|
74
74
|
def self.model_for_labels(labels)
|
75
|
+
labels.sort!
|
75
76
|
return MODELS_FOR_LABELS_CACHE[labels] if MODELS_FOR_LABELS_CACHE[labels]
|
76
77
|
|
77
78
|
models = WRAPPED_CLASSES.select do |model|
|
@@ -19,19 +19,8 @@ module Neo4j
|
|
19
19
|
@result_cache ||= {}
|
20
20
|
return result_cache_for(node, rel) if result_cache?(node, rel)
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
pluck_vars << @rel_var if rel
|
25
|
-
|
26
|
-
result = pluck(*pluck_vars)
|
27
|
-
|
28
|
-
result.each do |object|
|
29
|
-
object.instance_variable_set('@source_query_proxy', self)
|
30
|
-
object.instance_variable_set('@source_proxy_result_cache', result)
|
31
|
-
if node && rel && object.last.is_a?(Neo4j::ActiveRel)
|
32
|
-
object.last.instance_variable_set(association.direction == :in ? '@from_node' : '@to_node', object.first)
|
33
|
-
end
|
34
|
-
end
|
22
|
+
result = pluck_vars(node, rel)
|
23
|
+
set_instance_caches(result, node, rel)
|
35
24
|
|
36
25
|
@result_cache[[node, rel]] ||= result
|
37
26
|
end
|
@@ -96,6 +85,25 @@ module Neo4j
|
|
96
85
|
def ensure_distinct(node, force = false)
|
97
86
|
@distinct || force ? "DISTINCT(#{node})" : node
|
98
87
|
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
def pluck_vars(node, rel)
|
92
|
+
vars = []
|
93
|
+
vars << ensure_distinct(identity) if node
|
94
|
+
vars << @rel_var if rel
|
95
|
+
pluck(*vars)
|
96
|
+
end
|
97
|
+
|
98
|
+
def set_instance_caches(instance, node, rel)
|
99
|
+
instance.each do |object|
|
100
|
+
object.instance_variable_set('@source_query_proxy', self)
|
101
|
+
object.instance_variable_set('@source_proxy_result_cache', instance)
|
102
|
+
if node && rel && object.last.is_a?(Neo4j::ActiveRel)
|
103
|
+
object.last.instance_variable_set(association.direction == :in ? '@from_node' : '@to_node', object.first)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
99
107
|
end
|
100
108
|
end
|
101
109
|
end
|
@@ -245,6 +245,10 @@ module Neo4j::Shared
|
|
245
245
|
# Converts hash to/from JSON
|
246
246
|
class JSONConverter < BaseConverter
|
247
247
|
class << self
|
248
|
+
def converted?(_value)
|
249
|
+
false
|
250
|
+
end
|
251
|
+
|
248
252
|
def convert_type
|
249
253
|
JSON
|
250
254
|
end
|
@@ -407,7 +411,7 @@ module Neo4j::Shared
|
|
407
411
|
# @param value The value for conversion.
|
408
412
|
def formatted_for_db?(found_converter, value)
|
409
413
|
return false unless found_converter.respond_to?(:db_type)
|
410
|
-
found_converter.respond_to?(:converted) ? found_converter.converted?(value) : value.is_a?(found_converter.db_type)
|
414
|
+
found_converter.respond_to?(:converted?) ? found_converter.converted?(value) : value.is_a?(found_converter.db_type)
|
411
415
|
end
|
412
416
|
|
413
417
|
def register_converter(converter)
|
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.1.
|
4
|
+
version: 8.1.3
|
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-06-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|