activegraph 11.1.0.alpha.3 → 11.1.0.beta.1

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
  SHA256:
3
- metadata.gz: 711b583f7886a76627f5b3f696e38de523bfefb0309eaed03c0b05c3667ad0b6
4
- data.tar.gz: 0daad52238037ba7b78fd4fca0c98cecf81d4b9b48b8af8505bfd28def03c7f4
3
+ metadata.gz: 4aade7db7557b1222b78e048550606354b0707a60c9375359a4f945b702763c2
4
+ data.tar.gz: a22b396cdc491118ecbaf947ac9e00d9ea088fe0df5afa51a3a38b7f085db9ff
5
5
  SHA512:
6
- metadata.gz: 9a456ac9a035520694c24d68e58e687208237dabfd185f57d845ec36a8caee1ade2f03cabc3cfb8a9dae1dff6dcbec2645b757a2b2935d88de2594a0f0ff7ba3
7
- data.tar.gz: 9ce3325eafd3f5edffa5b0931039748e652150e0a403312eddbfd9a7321af5bbce72f3c31ae7e11588e6f2890ec3045abd5fba38bdc515ed36dcc505eb92e71c
6
+ metadata.gz: 663bc1323338cc7261cb2281b5ad6a86d794baed1fd2dc82a08f8d1b5eae593a151927529330425d8ffdc71adb17e8a7c70aa3872c63641cd2d77dcfe46016cc
7
+ data.tar.gz: c894eff95679b5982e418dccff5deb160ff41a46e661bee2f8278b230ab59fe20befc8aed83b8144dd112485df98d61c6fa1f60d226f63a1df3db6cd34b4a9a4
@@ -34,8 +34,16 @@ module ActiveGraph::Node
34
34
 
35
35
  include Enumerable
36
36
 
37
- def each(&block)
38
- result_nodes.each(&block)
37
+ def each(node = true, rel = nil, &block)
38
+ return [] unless node || rel
39
+
40
+ if node && rel
41
+ result_nodes.zip(rels)
42
+ elsif node
43
+ result_nodes
44
+ else
45
+ rels
46
+ end.each(&block)
39
47
  end
40
48
 
41
49
  def each_rel(&block)
@@ -103,11 +111,11 @@ module ActiveGraph::Node
103
111
 
104
112
  def add_to_cache(object, rel = nil)
105
113
  (@cached_rels ||= []) << rel if rel
106
- (@cached_result ||= []).tap { |results| results << object unless results.include?(object) }
114
+ (@cached_result ||= []).tap { |results| results << object if object && !results.include?(object) }
107
115
  end
108
116
 
109
117
  def rels
110
- @cached_rels || super
118
+ @cached_rels || super.tap { |rels| rels.each { |rel| add_to_cache(nil, rel) } }
111
119
  end
112
120
 
113
121
  def cache_query_proxy_result
@@ -48,7 +48,7 @@ module ActiveGraph
48
48
  end
49
49
 
50
50
  def propagate_context(query_proxy)
51
- query_proxy.instance_variable_set(:@distinct, @distinct)
51
+ [:@distinct, :@rel_var].each { |var| query_proxy.instance_variable_set(var, instance_variable_get(var)) }
52
52
  end
53
53
 
54
54
  # @return [Integer] number of nodes of this class
@@ -89,10 +89,7 @@ COMMENT
89
89
 
90
90
  ActiveGraph::Migrations::Schema.synchronize_schema_data(schema_data, args[:remove_missing])
91
91
 
92
- ActiveGraph::Base.transaction do
93
- runner = ActiveGraph::Migrations::Runner.new
94
- end
95
-
92
+ runner = ActiveGraph::Base.transaction { ActiveGraph::Migrations::Runner.new }
96
93
  ActiveGraph::Base.transaction do
97
94
  runner.mark_versions_as_complete(schema_data[:versions]) # Run in test mode?
98
95
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveGraph
2
- VERSION = '11.1.0.alpha.3'
2
+ VERSION = '11.1.0.beta.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activegraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.1.0.alpha.3
4
+ version: 11.1.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Brian Underwood, Chris Grigg, Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-02 00:00:00.000000000 Z
11
+ date: 2022-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -444,7 +444,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
444
444
  - !ruby/object:Gem::Version
445
445
  version: 1.3.1
446
446
  requirements: []
447
- rubygems_version: 3.3.7
447
+ rubygems_version: 3.3.3
448
448
  signing_key:
449
449
  specification_version: 4
450
450
  summary: A graph database for Ruby