neo4j 6.0.0.alpha.4 → 6.0.0.alpha.5

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: c2d0692e7269df978b91b6159ae61bf13d5b1e6f
4
- data.tar.gz: fcbe9452451260b44431ed4d69559d0880a218c3
3
+ metadata.gz: 51e7f7f2111156aec6a405435bfb1d54ba872b21
4
+ data.tar.gz: 25ff673e9f3baf99812fdf9a9cf090e7071004b7
5
5
  SHA512:
6
- metadata.gz: fe05be04e219c87f1af15db0480b6b89ea627b466fe20509e1e46365f8f09f40714a4d0b0118917e91766dca134f4c19754d7d4b661b0b1a3245687a89e0a199
7
- data.tar.gz: 9b8fb18005ef90978d9d1acd2589179f1e6aa661b1b38cf67c342cb49b337eef1a37cf7fa7a172e1e32c0171847cdc21bd85e6d8202d7fb1210a08835f6d5beb
6
+ metadata.gz: 510aa9f0861552d70b27a5e15c765ed24c7ee47d6a74a80d11daf402a616da286fb69d4456159c34e3d9c52f8928ae6ad8de85e168592fa1ded6ea8b28340da4
7
+ data.tar.gz: b5a78ff50ce7b9815687f7e9dcc619dae0f21dbf68668f0190c7b1b83328948db39bd3eeccb64d0aaefe219e9d3e2af997fff8a8934b81e98518eb659d50a45c
@@ -3,11 +3,11 @@ 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
- ## [6.0.0.alpha.4] - 10-17-2015
6
+ ## [6.0.0.alpha.5] - 10-18-2015
7
7
 
8
- ### Fixed
8
+ ### Changed
9
9
 
10
- - `QueryProxy` was not converting Boolean properties correctly
10
+ - Change size and length so that they match expected Ruby / ActiveRecord behavior (see http://stackoverflow.com/questions/6083219/activerecord-size-vs-count and #875)
11
11
 
12
12
  ## [6.0.0.alpha.3] - 10-14-2015
13
13
 
@@ -13,9 +13,10 @@ module Neo4j
13
13
  result(node, rel).each(&block)
14
14
  end
15
15
 
16
- def result(node = true, rel = true)
16
+ def result(node = true, rel = nil)
17
+ puts '@result_cache', @result_cache.inspect
17
18
  @result_cache ||= {}
18
- return @result_cache[[node, rel]] if @result_cache[[node, rel]]
19
+ return result_cache_for(node, rel) if has_result_cache?(node, rel)
19
20
 
20
21
  pluck_vars = []
21
22
  pluck_vars << identity if node
@@ -31,6 +32,14 @@ module Neo4j
31
32
  @result_cache[[node, rel]] ||= result
32
33
  end
33
34
 
35
+ def has_result_cache?(node = true, rel = nil)
36
+ !!result_cache_for(node, rel)
37
+ end
38
+
39
+ def result_cache_for(node = true, rel = nil)
40
+ (@result_cache || {})[[node, rel]]
41
+ end
42
+
34
43
  def fetch_result_cache
35
44
  @result_cache ||= yield
36
45
  end
@@ -63,8 +63,18 @@ module Neo4j
63
63
  end
64
64
  end
65
65
 
66
- alias_method :size, :count
67
- alias_method :length, :count
66
+ def size
67
+ puts 'size'
68
+ if has_result_cache?
69
+ result_cache_for.length
70
+ else
71
+ count
72
+ end
73
+ end
74
+
75
+ def length
76
+ to_a.length
77
+ end
68
78
 
69
79
  # TODO: update this with public API methods if/when they are exposed
70
80
  def limit_value
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '6.0.0.alpha.4'
2
+ VERSION = '6.0.0.alpha.5'
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: 6.0.0.alpha.4
4
+ version: 6.0.0.alpha.5
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: 2015-10-17 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orm_adapter
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  version: 1.3.1
327
327
  requirements: []
328
328
  rubyforge_project: neo4j
329
- rubygems_version: 2.4.6
329
+ rubygems_version: 2.4.5.1
330
330
  signing_key:
331
331
  specification_version: 4
332
332
  summary: A graph database for Ruby