activegraph-extensions 0.0.2-java → 0.0.3-java

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: 6c32c0f026083ce5175029f15de509da256e64f55456d29ee5c26358a43694ac
4
- data.tar.gz: 78ce8b9d21c30b326a4314487ac75d6d0b5e449dcf20fe3c9ef6da29f332ce9f
3
+ metadata.gz: fbb2be9a5d8f1afc55b3888e1afc33940a2eb709de5afae7144f25992d2d0873
4
+ data.tar.gz: 23a259b8d2dffd7e6f73e552275fe0d9b9849bfcb80bc437be21c6e32944d5fe
5
5
  SHA512:
6
- metadata.gz: 00bdc4fb09667e26efcc0f376c6e54d566dd2f3ab1fc804f6e24b95da84981060ca920163c9b7c550d2da1bc44a50137beb6be7dad0063bdc1d71581df57ad1c
7
- data.tar.gz: 61f86edaea0e316af6a97190d16dd25d582e1cd96a0778547101db87c520fdff8973fc5e71a2901169eee0ce63730c810aa95a90281a9b9fb6cf680e36c34f8a
6
+ metadata.gz: 55a7e0e10065e825acef207348a9277162af5d6ec81b158b957b266e37ba0fa98c6aa620cca84a31b253a58574880742a13d7f7f7cda576fd1f7dab3e60eda15
7
+ data.tar.gz: 679aa1b9d1ad94633506b1938cb3d50ea3bd2af2bd9392f352370f5d4410476cabf1a327bae1d6cafdbd18f5b62650b94584c826ea65cb4bb61be1a035eaa57a
data/CHANGELOG.md CHANGED
@@ -1 +1,7 @@
1
- # Change Log
1
+ # Change Log
2
+
3
+ ## [0.0.3] 2023-02-23
4
+
5
+ ## Fixed
6
+
7
+ - Fixed issue where there was 500 error when we are eagerloding relations with multiple optional matches and some privious match was haveing authorization and next one was skipping authorization for those same nodes. This would result in a collection of related nodes where some nodes were null and corresponding next optional match nodes on path had values.
@@ -33,7 +33,6 @@ DESCRIPTION
33
33
  s.add_development_dependency('guard-rspec')
34
34
  s.add_development_dependency('guard-rubocop')
35
35
  s.add_development_dependency('neo4j-rake_tasks', '>= 0.3.0')
36
- # s.add_development_dependency("neo4j-#{ENV['driver'] == 'java' ? 'java' : 'ruby'}-driver", '~> 4.1.0.beta.1')
37
36
  s.add_development_dependency('os')
38
37
  s.add_development_dependency('pry')
39
38
  s.add_development_dependency('railties', '>= 4.0')
@@ -45,8 +45,9 @@ module ActiveGraphExtensions
45
45
  end
46
46
 
47
47
  def limit_node_in_where_clause(query, path)
48
- root_path = path[0..0]
49
- query.where("`#{path_name(root_path)}` in [i IN #{node_from_collection(root_path)} | i[1]]")
48
+ (path.length - 1).times.inject(query) do |query_with_where, index|
49
+ query_with_where.where("`#{path_name(path[0..index])}` in [i IN #{node_from_collection(path[0..index])} | i[1]]")
50
+ end
50
51
  end
51
52
 
52
53
  def node_from_collection(path_step)
@@ -35,20 +35,10 @@ module ActiveGraphExtensions
35
35
  end
36
36
 
37
37
  def process_string(str)
38
- # head, rest = str.split('.', 2)
39
- # head, association_limit = extract_assoc_limit(head)
40
- # k, length = head.split('*', -2)
41
- # length = { max: length } if length
42
- #add_nested(k.to_sym, rest, length, association_limit)
43
38
  map = StringParsers::RelationParser.new.parse(str)
44
39
  add_nested(map[:rel_name].to_sym, map[:rest_str].to_s.presence, map[:length_part], map[:limit_digit])
45
40
  end
46
41
 
47
- # def extract_assoc_limit(str)
48
- # transformer = StringParsers::RelationParamTransformer.new(str)
49
- # [transformer.rel_name_n_length, transformer.rel_limit_number]
50
- # end
51
-
52
42
  def process_hash(spec)
53
43
  spec = spec.dup
54
44
  @options = spec.delete(:_options)
@@ -10,10 +10,8 @@ module ActiveGraphExtensions
10
10
  rel_model = relationship_model(path)
11
11
  return {} if @opts.blank? || !(auth_scope = authorized_scope(rel_model, path))
12
12
  conf = { rels: [], chain: {} }
13
- proxy = auth_scope.call(var, "#{var}_rel", user: @opts[:user],
14
- properties: properties_for(rel_model),
15
- privileges: @opts[:privileges],
16
- rel_length: path.last.rel_length)
13
+ proxy = auth_scope.call(var, "#{var}_rel", @opts.merge(properties: properties_for(rel_model),
14
+ rel_length: path.last.rel_length))
17
15
  proxy_rel_parts(proxy.instance_variable_get(:@break_proxy) || proxy, conf)
18
16
  conf
19
17
  end
@@ -57,7 +57,7 @@ module ActiveGraphExtensions
57
57
 
58
58
  def optional_match_with_where(query, path, vars)
59
59
  computed_query = super
60
- computed_query = limit_node_in_where_clause(computed_query, path) if multipath_with_sideload_limit?(path)
60
+ computed_query = limit_node_in_where_clause(computed_query, path) if multipath?(path)
61
61
  skip_order? && !path.last.rel_length ? computed_query : optional_order(computed_query, path, vars)
62
62
  end
63
63
 
@@ -1,3 +1,3 @@
1
1
  module ActiveGraphExtensions
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activegraph-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: java
6
6
  authors:
7
7
  - Amit Suryavanshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-23 00:00:00.000000000 Z
11
+ date: 2023-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: parslet
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: '0'
19
+ name: parslet
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,12 +25,12 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: activegraph
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
32
  version: '0'
33
+ name: activegraph
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
@@ -39,12 +39,12 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: guard
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
47
+ name: guard
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -53,12 +53,12 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: guard-rspec
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
60
  version: '0'
61
+ name: guard-rspec
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -67,12 +67,12 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: guard-rubocop
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - ">="
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0'
75
+ name: guard-rubocop
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
@@ -81,12 +81,12 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: neo4j-rake_tasks
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - ">="
88
87
  - !ruby/object:Gem::Version
89
88
  version: 0.3.0
89
+ name: neo4j-rake_tasks
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -95,12 +95,12 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.3.0
97
97
  - !ruby/object:Gem::Dependency
98
- name: os
99
98
  requirement: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - ">="
102
101
  - !ruby/object:Gem::Version
103
102
  version: '0'
103
+ name: os
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,12 +109,12 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: pry
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - ">="
116
115
  - !ruby/object:Gem::Version
117
116
  version: '0'
117
+ name: pry
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -123,12 +123,12 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: railties
127
126
  requirement: !ruby/object:Gem::Requirement
128
127
  requirements:
129
128
  - - ">="
130
129
  - !ruby/object:Gem::Version
131
130
  version: '4.0'
131
+ name: railties
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,12 +137,12 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '4.0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rake
141
140
  requirement: !ruby/object:Gem::Requirement
142
141
  requirements:
143
142
  - - ">="
144
143
  - !ruby/object:Gem::Version
145
144
  version: '0'
145
+ name: rake
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
@@ -151,12 +151,12 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rubocop
155
154
  requirement: !ruby/object:Gem::Requirement
156
155
  requirements:
157
156
  - - ">="
158
157
  - !ruby/object:Gem::Version
159
158
  version: 0.56.0
159
+ name: rubocop
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
@@ -165,12 +165,12 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.56.0
167
167
  - !ruby/object:Gem::Dependency
168
- name: yard
169
168
  requirement: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - ">="
172
171
  - !ruby/object:Gem::Version
173
172
  version: '0'
173
+ name: yard
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
@@ -179,12 +179,12 @@ dependencies:
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: dryspec
183
182
  requirement: !ruby/object:Gem::Requirement
184
183
  requirements:
185
184
  - - ">="
186
185
  - !ruby/object:Gem::Version
187
186
  version: '0'
187
+ name: dryspec
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
@@ -193,12 +193,12 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
- name: rspec
197
196
  requirement: !ruby/object:Gem::Requirement
198
197
  requirements:
199
198
  - - "<"
200
199
  - !ruby/object:Gem::Version
201
200
  version: '3.10'
201
+ name: rspec
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
@@ -206,8 +206,8 @@ dependencies:
206
206
  - - "<"
207
207
  - !ruby/object:Gem::Version
208
208
  version: '3.10'
209
- description: " Additional features to activegraph, like sideload limiting, authorizing
210
- sideloads etc.\n"
209
+ description: " Additional features to activegraph, like sideload limiting, authorizing\
210
+ \ sideloads etc.\n"
211
211
  email: amitbsuryavabshi@mail.com
212
212
  executables: []
213
213
  extensions: []
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubygems_version: 3.3.7
258
+ rubygems_version: 3.0.6
259
259
  signing_key:
260
260
  specification_version: 4
261
261
  summary: Additional features to activegraph