neo4j 7.0.9 → 7.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/neo4j/active_node/has_n.rb +13 -9
- data/lib/neo4j/active_node/query/query_proxy.rb +1 -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: ef009c057d36a788a10a49c2879e59a4ee57016a
|
4
|
+
data.tar.gz: 50b2b6437ad96458f9ea23905f573a5c07bdff98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d6568b27eab7758049ef41a8c2eeeaed7aa11f1da5cf7217ffa97a1ee3685e63c0e7a2a07b16f51e62bee812d33a37a923f8f2fee2171cfec15b7ea4247749a
|
7
|
+
data.tar.gz: fc0bf2a7c8f30f09746a4a8af37e9827c5920d3b6f94e0d02f22e0621944b987cdf39d6a4a94680d2252f0f19aa7c3278649a65f9e2d0cf7b97e0b66109ca34f
|
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
|
+
## [7.0.10] - 06-07-2016
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- Calling `.create` on associations shouldn't involve extra queries (thanks for the report from rahulmeena13 / see #1216)
|
11
|
+
|
6
12
|
## [7.0.9] - 05-30-2016
|
7
13
|
|
8
14
|
### Fixed
|
@@ -8,11 +8,11 @@ module Neo4j::ActiveNode
|
|
8
8
|
# It uses a QueryProxy to get results
|
9
9
|
# But also caches results and can have results cached on it
|
10
10
|
class AssociationProxy
|
11
|
-
def initialize(query_proxy, deferred_objects = [],
|
11
|
+
def initialize(query_proxy, deferred_objects = [], result_cache_proc = nil)
|
12
12
|
@query_proxy = query_proxy
|
13
13
|
@deferred_objects = deferred_objects
|
14
14
|
|
15
|
-
|
15
|
+
@result_cache_proc = result_cache_proc
|
16
16
|
|
17
17
|
# Represents the thing which can be enumerated
|
18
18
|
# default to @query_proxy, but will be set to
|
@@ -88,7 +88,11 @@ module Neo4j::ActiveNode
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def cache_query_proxy_result
|
91
|
-
@query_proxy.to_a.tap { |result| cache_result(result) }
|
91
|
+
(result_cache_proc_cache || @query_proxy).to_a.tap { |result| cache_result(result) }
|
92
|
+
end
|
93
|
+
|
94
|
+
def result_cache_proc_cache
|
95
|
+
@result_cache_proc_cache ||= @result_cache_proc.call if @result_cache_proc
|
92
96
|
end
|
93
97
|
|
94
98
|
def clear_cache_result
|
@@ -105,7 +109,7 @@ module Neo4j::ActiveNode
|
|
105
109
|
@query_proxy.public_send(:replace_with, *args)
|
106
110
|
end
|
107
111
|
|
108
|
-
QUERY_PROXY_METHODS = [:<<, :delete]
|
112
|
+
QUERY_PROXY_METHODS = [:<<, :delete, :create]
|
109
113
|
CACHED_RESULT_METHODS = []
|
110
114
|
|
111
115
|
def method_missing(method_name, *args, &block)
|
@@ -171,10 +175,10 @@ module Neo4j::ActiveNode
|
|
171
175
|
hash = association_proxy_hash(name, options)
|
172
176
|
association_proxy_cache_fetch(hash) do
|
173
177
|
if result_cache = self.instance_variable_get('@source_proxy_result_cache')
|
174
|
-
|
175
|
-
|
178
|
+
cache = nil
|
176
179
|
result_cache.inject(nil) do |proxy_to_return, object|
|
177
|
-
proxy = fresh_association_proxy(name, options.merge(start_object: object),
|
180
|
+
proxy = fresh_association_proxy(name, options.merge(start_object: object),
|
181
|
+
proc { (cache ||= previous_proxy_results_by_previous_id(result_cache, name))[object.neo_id] })
|
178
182
|
|
179
183
|
object.association_proxy_cache[hash] = proxy
|
180
184
|
|
@@ -188,8 +192,8 @@ module Neo4j::ActiveNode
|
|
188
192
|
|
189
193
|
private
|
190
194
|
|
191
|
-
def fresh_association_proxy(name, options = {},
|
192
|
-
AssociationProxy.new(association_query_proxy(name, options), deferred_nodes_for_association(name),
|
195
|
+
def fresh_association_proxy(name, options = {}, result_cache_proc = nil)
|
196
|
+
AssociationProxy.new(association_query_proxy(name, options), deferred_nodes_for_association(name), result_cache_proc)
|
193
197
|
end
|
194
198
|
|
195
199
|
def previous_proxy_results_by_previous_id(result_cache, association_name)
|
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: 7.0.
|
4
|
+
version: 7.0.10
|
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: 2016-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|