neo4j-core 7.1.2 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4j-core/query_clauses.rb +9 -16
- data/lib/neo4j-core/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: e7a349a32447c684e13fa3712b4b6c886229e956
|
4
|
+
data.tar.gz: a0a5c7964efbee681b46b5c4f7d44f6b93f78e42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba6151f2678bb163439b21846d0377fd1126397f9f7e01f6052cced6e7a900d55d25e46fbe834e93b9502d27f723ed650a5b6fdf73390febf2628bd3ed523ca3
|
7
|
+
data.tar.gz: c3b4a9c49985e8793c356a170c94b6d18ac6902533ee54f40587d2c04b0176654e6f8370efb66c9f6bb079c206ab840041bfd26cb3c20fc9b4b80f8f6938c823
|
@@ -111,11 +111,7 @@ module Neo4j
|
|
111
111
|
def attributes_from_key_and_value(_key, value)
|
112
112
|
return nil unless value.is_a?(Hash)
|
113
113
|
|
114
|
-
|
115
|
-
value.first[1]
|
116
|
-
else
|
117
|
-
value
|
118
|
-
end
|
114
|
+
value.values.map(&:class) == [Hash] ? value.first[1] : value
|
119
115
|
end
|
120
116
|
|
121
117
|
class << self
|
@@ -166,11 +162,7 @@ module Neo4j
|
|
166
162
|
end
|
167
163
|
|
168
164
|
def from_key_and_single_value(key, value)
|
169
|
-
|
170
|
-
"ID(#{key})"
|
171
|
-
else
|
172
|
-
"#{key}.#{value}"
|
173
|
-
end
|
165
|
+
value.to_sym == :neo_id ? "ID(#{key})" : "#{key}.#{value}"
|
174
166
|
end
|
175
167
|
end
|
176
168
|
|
@@ -196,19 +188,21 @@ module Neo4j
|
|
196
188
|
self.class.paramaterize_key!(param)
|
197
189
|
|
198
190
|
if value.is_a?(Range)
|
199
|
-
|
200
|
-
|
201
|
-
"#{key} IN RANGE({#{min_param}}, {#{max_param}})"
|
191
|
+
range_key_value_string(key, value, previous_keys, param)
|
202
192
|
else
|
203
193
|
value = value.first if array_value?(value, is_set) && value.size == 1
|
204
|
-
operator = array_value?(value, is_set) ? 'IN' : '='
|
205
194
|
|
206
195
|
param = add_param(param, value)
|
207
196
|
|
208
|
-
"#{key} #{
|
197
|
+
"#{key} #{array_value?(value, is_set) ? 'IN' : '='} {#{param}}"
|
209
198
|
end
|
210
199
|
end
|
211
200
|
|
201
|
+
def range_key_value_string(key, value, previous_keys, param)
|
202
|
+
begin_param, end_param = add_params("#{param}_range_min" => value.begin, "#{param}_range_max" => value.end)
|
203
|
+
"#{key} >= {#{begin_param}} AND #{previous_keys[-2]}.#{key} <#{'=' unless value.exclude_end?} {#{end_param}}"
|
204
|
+
end
|
205
|
+
|
212
206
|
def array_value?(value, is_set)
|
213
207
|
value.is_a?(Array) && !is_set
|
214
208
|
end
|
@@ -281,7 +275,6 @@ module Neo4j
|
|
281
275
|
when Hash then hash_key_value_string(key, value, previous_keys)
|
282
276
|
when NilClass then "#{key} IS NULL"
|
283
277
|
when Regexp then regexp_key_value_string(key, value, previous_keys)
|
284
|
-
when Array, Range then key_value_string(key, value, previous_keys)
|
285
278
|
else
|
286
279
|
key_value_string(key, value, previous_keys)
|
287
280
|
end
|
data/lib/neo4j-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Chris Grigg, Brian Underwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|