neo4apis 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/neo4apis/base.rb +3 -4
- data/neo4apis.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89023a93271f59dea6fa05a98b70f459bf4d6b26
|
|
4
|
+
data.tar.gz: 82c4afb82a045d86f231d2330591c512fc11afb5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 135b1f1188780828302371977b930b40778460d29d6d6b66f188d3c61d10bbb92d8fbf7bdcf047282d2e7ae38ee242c23de5b5fb186b07ba2f78f24b31c60bfb
|
|
7
|
+
data.tar.gz: 4cb5e535fe4c08e479b92cd2a9c300ec3909a59a59fce3ae1cdc63228eb782461fa8af07df3d1fe4037ecd33f78fe2d6766c8413cc63868f66f7477cf5e9140b
|
data/lib/neo4apis/base.rb
CHANGED
|
@@ -132,17 +132,16 @@ QUERY
|
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def create_relationship_query(type, source, target, props)
|
|
135
|
-
return if props.empty?
|
|
136
|
-
|
|
137
135
|
type = type.to_s.send(relationship_transform) if relationship_transform != :none
|
|
138
136
|
|
|
139
137
|
cypher = <<-QUERY
|
|
140
|
-
MATCH (source:`#{source.label}`), (target:`#{
|
|
138
|
+
MATCH (source:`#{source.label}`), (target:`#{target.label}`)
|
|
141
139
|
WHERE source.#{source.uuid_field}={source_value} AND target.#{target.uuid_field}={target_value}
|
|
142
140
|
MERGE source-[rel:`#{type}`]->target
|
|
143
|
-
SET #{set_attributes(:rel, props.keys)}
|
|
144
141
|
QUERY
|
|
145
142
|
|
|
143
|
+
cypher << " SET #{set_attributes(:rel, props.keys)}" unless props.empty?
|
|
144
|
+
|
|
146
145
|
OpenStruct.new({to_cypher: cypher,
|
|
147
146
|
merge_params: {source_value: source.uuid_value, target_value: target.uuid_value, props: props}})
|
|
148
147
|
end
|
data/neo4apis.gemspec
CHANGED