activegraph 11.2.0 → 11.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/active_graph/node/scope.rb +18 -8
- data/lib/active_graph/shared/enum.rb +1 -1
- data/lib/active_graph/tasks/migration.rake +5 -1
- data/lib/active_graph/version.rb +1 -1
- metadata +39 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a34cf88985a4d6f6d73da937abb94f5adbf429fd9a0c06e175600b04cf49863
|
4
|
+
data.tar.gz: e43528c6888cca7ac127ed33b972cc15e0a2f75dc291f187e7a2e5158e2b5f35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 853b4a12d5d2fb72acf05e747d4d77612ee35f3746883091c56786c16abbd6041e551eda8d8edea64659922569431e1469c239a04905301d600526822db162cc
|
7
|
+
data.tar.gz: a9940abfa130c32b50b5d1c6b730b5a2e2e3534a1c53b95983850075fc3da3736af018f7d0d3cb6e7612f4b49f5ab4751e3dd9332bc8c41bc647e0cfc73e540e
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@ 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
|
+
## [11.3.0] 2023-02-10
|
7
|
+
|
8
|
+
## Added
|
9
|
+
|
10
|
+
- support for keyword arguments in scopes
|
11
|
+
|
12
|
+
## Fixed
|
13
|
+
|
14
|
+
- Fixed issue with psych https://github.com/neo4jrb/activegraph/issues/1684 (Thanks @chytreg)
|
15
|
+
|
6
16
|
## [11.2.0] 2023-02-06
|
7
17
|
|
8
18
|
## Added
|
@@ -39,15 +39,15 @@ module ActiveGraph::Node
|
|
39
39
|
|
40
40
|
klass = class << self; self; end
|
41
41
|
klass.instance_eval do
|
42
|
-
define_method(name) do |*query_params|
|
42
|
+
define_method(name) do |*query_params, **kwargs|
|
43
43
|
eval_context = ScopeEvalContext.new(self, current_scope || self.query_proxy)
|
44
44
|
proc = full_scopes[name.to_sym]
|
45
|
-
_call_scope_context(eval_context, query_params, proc)
|
45
|
+
_call_scope_context(eval_context, *query_params, **kwargs, &proc)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
define_method(name) do |*query_params|
|
50
|
-
as(:n).public_send(name, *query_params)
|
49
|
+
define_method(name) do |*query_params, **kwargs|
|
50
|
+
as(:n).public_send(name, *query_params, **kwargs)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -76,8 +76,14 @@ module ActiveGraph::Node
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
def _call_scope_context(eval_context, query_params, proc)
|
80
|
-
|
79
|
+
def _call_scope_context(eval_context, *query_params, **kwargs, &proc)
|
80
|
+
last_vararg_index = proc.arity - (kwargs.empty? ? 1 : 2)
|
81
|
+
query_params.fill(nil, query_params.length..last_vararg_index)
|
82
|
+
if kwargs.empty? # for jruby-9.3 compatibility
|
83
|
+
eval_context.instance_exec(*query_params, &proc)
|
84
|
+
else
|
85
|
+
eval_context.instance_exec(*query_params, **kwargs, &proc)
|
86
|
+
end
|
81
87
|
end
|
82
88
|
|
83
89
|
def current_scope #:nodoc:
|
@@ -118,8 +124,12 @@ module ActiveGraph::Node
|
|
118
124
|
|
119
125
|
# method_missing is not delegated to super class but to aggregated class
|
120
126
|
# rubocop:disable Style/MethodMissingSuper
|
121
|
-
def method_missing(name, *params, &block)
|
122
|
-
|
127
|
+
def method_missing(name, *params, **kwargs, &block)
|
128
|
+
if kwargs.empty? # for jruby-9.3 compatibility
|
129
|
+
query_proxy_or_target.public_send(name, *params, &block)
|
130
|
+
else
|
131
|
+
query_proxy_or_target.public_send(name, *params, **kwargs, &block)
|
132
|
+
end
|
123
133
|
end
|
124
134
|
# rubocop:enable Style/MethodMissingSuper
|
125
135
|
|
@@ -41,7 +41,7 @@ module ActiveGraph::Shared
|
|
41
41
|
# Media.enum type: { image: 1, video: 2, unknown: 3 }
|
42
42
|
#
|
43
43
|
# @see http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
|
44
|
-
def enum(parameters
|
44
|
+
def enum(**parameters)
|
45
45
|
options, parameters = *split_options_and_parameters(parameters)
|
46
46
|
parameters.each do |property_name, enum_keys|
|
47
47
|
enum_keys = normalize_key_list enum_keys, options
|
@@ -83,7 +83,11 @@ COMMENT
|
|
83
83
|
|
84
84
|
args.with_defaults(remove_missing: false)
|
85
85
|
|
86
|
-
schema_data =
|
86
|
+
schema_data = if Gem::Requirement.new('>= 4') =~ Gem::Version.new(Psych::VERSION)
|
87
|
+
YAML.safe_load(File.read(SCHEMA_YAML_PATH), permitted_classes: [Symbol])
|
88
|
+
else
|
89
|
+
YAML.safe_load(File.read(SCHEMA_YAML_PATH), [Symbol])
|
90
|
+
end
|
87
91
|
|
88
92
|
ActiveGraph::Base.subscribe_to_query(&method(:puts))
|
89
93
|
|
data/lib/active_graph/version.rb
CHANGED
metadata
CHANGED
@@ -1,262 +1,262 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activegraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.
|
4
|
+
version: 11.3.0
|
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: 2023-02-
|
11
|
+
date: 2023-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: activemodel
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '4.0'
|
20
|
-
|
19
|
+
name: activemodel
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '4.0'
|
34
|
-
|
33
|
+
name: activesupport
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '4.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: i18n
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "!="
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: 1.8.8
|
48
|
-
|
47
|
+
name: i18n
|
49
48
|
prerelease: false
|
49
|
+
type: :runtime
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "!="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.8.8
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: neo4j-ruby-driver
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ">="
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 4.4.1
|
62
|
-
|
61
|
+
name: neo4j-ruby-driver
|
63
62
|
prerelease: false
|
63
|
+
type: :runtime
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 4.4.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: orm_adapter
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
72
|
- - "~>"
|
74
73
|
- !ruby/object:Gem::Version
|
75
74
|
version: 0.5.0
|
76
|
-
|
75
|
+
name: orm_adapter
|
77
76
|
prerelease: false
|
77
|
+
type: :runtime
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.5.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: sorted_set
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
86
85
|
requirements:
|
87
86
|
- - ">="
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: '0'
|
90
|
-
|
89
|
+
name: sorted_set
|
91
90
|
prerelease: false
|
91
|
+
type: :runtime
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: guard
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
100
99
|
requirements:
|
101
100
|
- - ">="
|
102
101
|
- !ruby/object:Gem::Version
|
103
102
|
version: '0'
|
104
|
-
|
103
|
+
name: guard
|
105
104
|
prerelease: false
|
105
|
+
type: :development
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: guard-rspec
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - ">="
|
116
115
|
- !ruby/object:Gem::Version
|
117
116
|
version: '0'
|
118
|
-
|
117
|
+
name: guard-rspec
|
119
118
|
prerelease: false
|
119
|
+
type: :development
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: guard-rubocop
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
128
127
|
requirements:
|
129
128
|
- - ">="
|
130
129
|
- !ruby/object:Gem::Version
|
131
130
|
version: '0'
|
132
|
-
|
131
|
+
name: guard-rubocop
|
133
132
|
prerelease: false
|
133
|
+
type: :development
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: neo4j-rake_tasks
|
141
140
|
requirement: !ruby/object:Gem::Requirement
|
142
141
|
requirements:
|
143
142
|
- - ">="
|
144
143
|
- !ruby/object:Gem::Version
|
145
144
|
version: 0.3.0
|
146
|
-
|
145
|
+
name: neo4j-rake_tasks
|
147
146
|
prerelease: false
|
147
|
+
type: :development
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 0.3.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name: os
|
155
154
|
requirement: !ruby/object:Gem::Requirement
|
156
155
|
requirements:
|
157
156
|
- - ">="
|
158
157
|
- !ruby/object:Gem::Version
|
159
158
|
version: '0'
|
160
|
-
|
159
|
+
name: os
|
161
160
|
prerelease: false
|
161
|
+
type: :development
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name: pry
|
169
168
|
requirement: !ruby/object:Gem::Requirement
|
170
169
|
requirements:
|
171
170
|
- - ">="
|
172
171
|
- !ruby/object:Gem::Version
|
173
172
|
version: '0'
|
174
|
-
|
173
|
+
name: pry
|
175
174
|
prerelease: false
|
175
|
+
type: :development
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
|
-
name: railties
|
183
182
|
requirement: !ruby/object:Gem::Requirement
|
184
183
|
requirements:
|
185
184
|
- - ">="
|
186
185
|
- !ruby/object:Gem::Version
|
187
186
|
version: '4.0'
|
188
|
-
|
187
|
+
name: railties
|
189
188
|
prerelease: false
|
189
|
+
type: :development
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '4.0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
|
-
name: rake
|
197
196
|
requirement: !ruby/object:Gem::Requirement
|
198
197
|
requirements:
|
199
198
|
- - ">="
|
200
199
|
- !ruby/object:Gem::Version
|
201
200
|
version: '0'
|
202
|
-
|
201
|
+
name: rake
|
203
202
|
prerelease: false
|
203
|
+
type: :development
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
|
-
name: rubocop
|
211
210
|
requirement: !ruby/object:Gem::Requirement
|
212
211
|
requirements:
|
213
212
|
- - ">="
|
214
213
|
- !ruby/object:Gem::Version
|
215
214
|
version: 0.56.0
|
216
|
-
|
215
|
+
name: rubocop
|
217
216
|
prerelease: false
|
217
|
+
type: :development
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: 0.56.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
|
-
name: yard
|
225
224
|
requirement: !ruby/object:Gem::Requirement
|
226
225
|
requirements:
|
227
226
|
- - ">="
|
228
227
|
- !ruby/object:Gem::Version
|
229
228
|
version: '0'
|
230
|
-
|
229
|
+
name: yard
|
231
230
|
prerelease: false
|
231
|
+
type: :development
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
|
-
name: dryspec
|
239
238
|
requirement: !ruby/object:Gem::Requirement
|
240
239
|
requirements:
|
241
240
|
- - ">="
|
242
241
|
- !ruby/object:Gem::Version
|
243
242
|
version: '0'
|
244
|
-
|
243
|
+
name: dryspec
|
245
244
|
prerelease: false
|
245
|
+
type: :development
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '0'
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
|
-
name: rspec
|
253
252
|
requirement: !ruby/object:Gem::Requirement
|
254
253
|
requirements:
|
255
254
|
- - "<"
|
256
255
|
- !ruby/object:Gem::Version
|
257
256
|
version: '3.10'
|
258
|
-
|
257
|
+
name: rspec
|
259
258
|
prerelease: false
|
259
|
+
type: :development
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
262
|
- - "<"
|
@@ -444,7 +444,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
444
|
- !ruby/object:Gem::Version
|
445
445
|
version: '0'
|
446
446
|
requirements: []
|
447
|
-
rubygems_version: 3.
|
447
|
+
rubygems_version: 3.3.25
|
448
448
|
signing_key:
|
449
449
|
specification_version: 4
|
450
450
|
summary: A graph database for Ruby
|