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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ec365e6c2d839f910c1cf4de9e3ff505eccee46
4
- data.tar.gz: 2b762b29dc08b63e97ea33568282646a531c45aa
3
+ metadata.gz: b73745139ccf41ae025891a9c0ff69c57cd94aeb
4
+ data.tar.gz: 6826e2a3b7abeef95527550178e854ebbdf4ecf8
5
5
  SHA512:
6
- metadata.gz: 778d06ad2a50499917623b6ddfe8bbde523799e413cb55c4b2f2497f802e3f5d9c3d81de718444cfc97913ccd159800b29022ee710980d97e1c788c29e0b7bbc
7
- data.tar.gz: 602d550908544156306de24498526feab2fa31da6d084a3f4d15aaf8c520f68a4923eee7580a35049cc9dd93cc451750faa1bd32336d566f799c724fd6ef47c3
6
+ metadata.gz: 13e0a756de72ad02f82b1526f84599d7cf47eaf20fbf842da11e008e09f1f231e01045bd1a2cba64c1a9cbbe7cf44a9fe8253f435730bef73545aed71af71c70
7
+ data.tar.gz: 0d2e7ffd847bb2c16389226f3ee9f8338f9eded404053fa8414f610901562bc916fc11b12f9260e6b14884cf5ab120e34331d3c9b98291dc6340342f098b1efb
@@ -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
- pluck_vars = []
23
- pluck_vars << ensure_distinct(identity) if node
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)
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '8.1.2'
2
+ VERSION = '8.1.3'
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: 8.1.2
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-21 00:00:00.000000000 Z
11
+ date: 2017-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orm_adapter