neo4j 9.1.1 → 9.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 357d7d905619778fedfbf148a40164b44273fc46
|
4
|
+
data.tar.gz: 772c939f9f73395d9f5f599500c5cfeb284d5c2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1183dd88f10aba61c3901d8358cfce1cc75a66f2d60f2697f9d18698c70d0a1f8b2a9e782a53bb78a6e92444419afa97cbfd9e143918cc2e2b937a9ec8c03758
|
7
|
+
data.tar.gz: b953fee710b55a6e150e2c168ca990b6daeb65da925217a15f940cf71b25805c3b9e472b5b98ec0a6356857b5f8352c48213d13895cb54337d6fad3ba87b66ff
|
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
|
+
## [9.1.2] 2017-12-18
|
7
|
+
|
8
|
+
## Fixed
|
9
|
+
|
10
|
+
- Issue where the order of `ORDER BY` was from `.order` method was not being respected for chains with `with_association` (thanks @klobuczek / see #1454)
|
11
|
+
|
6
12
|
## [9.1.1] 2017-12-12
|
7
13
|
|
8
14
|
## Fixed
|
@@ -95,13 +95,16 @@ module Neo4j
|
|
95
95
|
#
|
96
96
|
# student.lessons.query_as(:l).with('your cypher here...')
|
97
97
|
def query_as(var, with_labels = true)
|
98
|
-
|
98
|
+
query_from_chain(chain, base_query(var, with_labels).params(@params), var)
|
99
|
+
.tap { |query| query.proxy_chain_level = _chain_level }
|
100
|
+
end
|
101
|
+
|
102
|
+
def query_from_chain(chain, base_query, var)
|
103
|
+
chain.inject(base_query) do |query, link|
|
99
104
|
args = link.args(var, rel_var)
|
100
105
|
|
101
106
|
args.is_a?(Array) ? query.send(link.clause, *args) : query.send(link.clause, args)
|
102
107
|
end
|
103
|
-
|
104
|
-
result_query.tap { |query| query.proxy_chain_level = _chain_level }
|
105
108
|
end
|
106
109
|
|
107
110
|
def base_query(var, with_labels = true)
|
@@ -46,9 +46,7 @@ module Neo4j
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def pluck_vars(node, rel)
|
49
|
-
|
50
|
-
|
51
|
-
perform_query
|
49
|
+
with_associations_tree.empty? ? super : perform_query
|
52
50
|
end
|
53
51
|
|
54
52
|
def perform_query
|
@@ -143,11 +141,13 @@ module Neo4j
|
|
143
141
|
|
144
142
|
def query_from_association_tree
|
145
143
|
previous_with_variables = []
|
146
|
-
with_associations_tree.paths.inject(query_as(identity).with(ensure_distinct(identity))) do |query, path|
|
144
|
+
no_order_query = with_associations_tree.paths.inject(query_as(identity).with(ensure_distinct(identity))) do |query, path|
|
147
145
|
with_association_query_part(query, path, previous_with_variables).tap do
|
148
146
|
previous_with_variables << path_name(path)
|
149
147
|
end
|
150
|
-
end
|
148
|
+
end
|
149
|
+
query_from_chain(@order_chain, no_order_query, identity)
|
150
|
+
.pluck(identity, "[#{with_associations_return_clause}]")
|
151
151
|
end
|
152
152
|
|
153
153
|
def with_association_query_part(base_query, path, previous_with_variables)
|
@@ -176,6 +176,12 @@ module Neo4j
|
|
176
176
|
def relationship_part(association, path_name)
|
177
177
|
"#{association.arrow_cypher(escape("#{path_name}_rel"))}(#{escape(path_name)})"
|
178
178
|
end
|
179
|
+
|
180
|
+
def chain
|
181
|
+
@order_chain, other_chain =
|
182
|
+
with_associations_tree.empty? ? [[], @chain] : @chain.partition { |link| link.clause == :order }
|
183
|
+
other_chain
|
184
|
+
end
|
179
185
|
end
|
180
186
|
end
|
181
187
|
end
|
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: 9.1.
|
4
|
+
version: 9.1.2
|
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-12-
|
11
|
+
date: 2017-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|