neo4j 5.2.1 → 5.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/neo4j/active_node/property.rb +20 -3
- 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: 158a55b23a8fd93af668549d93b6ae70c78de131
|
4
|
+
data.tar.gz: bf51075fa56f939a0f1121cf31f42358edf60ec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12bf440770240a70cef138bb2760a97399f476b6d76f5a1bf03ea08184d421771d1152ecfae0d5791debd10c2f040f115a81761ad6b12936d366807caffef487
|
7
|
+
data.tar.gz: c3bd8351338be1ab5e5d5f503a61338d88edab6b9dd4ec418347bb56935f09fa37b0f8d1c7a98b75e80335fca4d13b325ae6d36c8daec5ff45f3eca5a5f87c42
|
data/CHANGELOG.md
CHANGED
@@ -15,16 +15,33 @@ module Neo4j::ActiveNode
|
|
15
15
|
def extract_association_attributes!(attributes)
|
16
16
|
return unless contains_association?(attributes)
|
17
17
|
attributes.each_with_object({}) do |(key, _), result|
|
18
|
-
result[key] = attributes.delete(key) if self.
|
18
|
+
result[key] = attributes.delete(key) if self.association_key?(key)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
def association_key?(key)
|
23
|
+
association_method_keys.include?(key.to_sym)
|
24
|
+
end
|
25
|
+
|
22
26
|
private
|
23
27
|
|
24
28
|
def contains_association?(attributes)
|
25
29
|
return false unless attributes
|
26
|
-
|
27
|
-
|
30
|
+
|
31
|
+
attributes.each_key.any?(&method(:association_key?))
|
32
|
+
end
|
33
|
+
|
34
|
+
# All keys which could be association setter methods (including _id/_ids)
|
35
|
+
def association_method_keys
|
36
|
+
@association_method_keys ||=
|
37
|
+
associations_keys.map(&:to_sym) +
|
38
|
+
associations.values.map do |association|
|
39
|
+
if association.type == :has_one
|
40
|
+
"#{association.name}_id"
|
41
|
+
elsif association.type == :has_many
|
42
|
+
"#{association.name.to_s.singularize}_ids"
|
43
|
+
end.to_sym
|
44
|
+
end
|
28
45
|
end
|
29
46
|
end
|
30
47
|
end
|
@@ -200,7 +200,7 @@ module Neo4j
|
|
200
200
|
|
201
201
|
def _nodeify!(*args)
|
202
202
|
other_nodes = [args].flatten!.map! do |arg|
|
203
|
-
(arg.is_a?(Integer) || arg.is_a?(String)) ? @model.find_by(
|
203
|
+
(arg.is_a?(Integer) || arg.is_a?(String)) ? @model.find_by(id: arg) : arg
|
204
204
|
end.compact
|
205
205
|
|
206
206
|
if @model && other_nodes.any? { |other_node| !other_node.class.mapped_label_names.include?(@model.mapped_label_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: 5.2.
|
4
|
+
version: 5.2.2
|
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: 2015-09-
|
11
|
+
date: 2015-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|