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: 5ce0613b4a45d089b70606742813dfbabb3714b5
4
- data.tar.gz: dee160a259043e930080bad2e04c063c2978a26f
3
+ metadata.gz: 357d7d905619778fedfbf148a40164b44273fc46
4
+ data.tar.gz: 772c939f9f73395d9f5f599500c5cfeb284d5c2f
5
5
  SHA512:
6
- metadata.gz: 19196cfc3b3cd6d01416ec6ecf9a5cdce925fb55c7c6e7f15d7ef9748d14c433b652b7743c729e8f2afc9b47b8e904c0d3d7df016a8602b5c87cd9ce90b78d9d
7
- data.tar.gz: 507a7ae74e8ef51c885afa65e778ee00614d34f2b3166faefc8c92c31f1f8f77619cea8b84752024f284d2edf93a54514594a3720882a7d0bf73894d260310f9
6
+ metadata.gz: 1183dd88f10aba61c3901d8358cfce1cc75a66f2d60f2697f9d18698c70d0a1f8b2a9e782a53bb78a6e92444419afa97cbfd9e143918cc2e2b937a9ec8c03758
7
+ data.tar.gz: b953fee710b55a6e150e2c168ca990b6daeb65da925217a15f940cf71b25805c3b9e472b5b98ec0a6356857b5f8352c48213d13895cb54337d6fad3ba87b66ff
@@ -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
- result_query = @chain.inject(base_query(var, with_labels).params(@params)) do |query, link|
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
- return super if with_associations_tree.size.zero?
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.pluck(identity, "[#{with_associations_return_clause}]")
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
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '9.1.1'
2
+ VERSION = '9.1.2'
3
3
  end
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.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-12 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orm_adapter