neo4j 6.0.3 → 6.0.4
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/CHANGELOG.md +6 -0
- data/lib/neo4j/active_node/has_n/association.rb +10 -2
- data/lib/neo4j/active_node/initialize.rb +5 -0
- data/lib/neo4j/active_rel/initialize.rb +9 -0
- data/lib/neo4j/active_rel/persistence.rb +4 -0
- data/lib/neo4j/shared/persistence.rb +2 -5
- data/lib/neo4j/shared/property.rb +5 -0
- 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: 8753bbe4fbbcae1dff577b11647a0820121d448b
|
4
|
+
data.tar.gz: 4b8672e9fc47bd07df4dcb7b3be15f7110f24b27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3eb1743258e2049d1a35a9d726fe960e21bbf488d70ab40b316dd8b8b74bbf69dcf0b9f66973a828d7aed6773a34e8046bacf14f0752694e9cce3b3e123b79b
|
7
|
+
data.tar.gz: 9bd62e09506edc3daa6b769e1fa40e032fbb9c59db50a1fa29d5c56812011fd660a48c5b81dbada76264571197cc6875fc38570be8a45d42ecf36ef20c5b9d9a
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@ 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
|
+
## [6.0.4] - 12-23-2015
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- When a `model_class` is specified on an association which is not an ActiveNode model, an error is raised
|
11
|
+
|
6
12
|
## [6.0.3] - 12-18-2015
|
7
13
|
|
8
14
|
### Fixed
|
@@ -91,9 +91,17 @@ module Neo4j
|
|
91
91
|
def target_class
|
92
92
|
return @target_class if @target_class
|
93
93
|
|
94
|
-
|
94
|
+
if target_class_names && target_class_names.size == 1
|
95
|
+
class_const = target_class_names[0].constantize
|
96
|
+
|
97
|
+
if !class_const.included_modules.include?(Neo4j::ActiveNode)
|
98
|
+
fail ArgumentError, "Invalid argument to `#{name}` association: `#{class_const.inspect}` is not an ActiveNode model"
|
99
|
+
end
|
100
|
+
|
101
|
+
@target_class = class_const
|
102
|
+
end
|
95
103
|
rescue NameError
|
96
|
-
raise ArgumentError, "
|
104
|
+
raise ArgumentError, "Invalid argument to `#{name}` association: Could not find class `#{target_class_names[0]}`"
|
97
105
|
end
|
98
106
|
|
99
107
|
def callback(type)
|
@@ -13,4 +13,9 @@ module Neo4j::ActiveNode::Initialize
|
|
13
13
|
changed_attributes && changed_attributes.clear
|
14
14
|
@attributes = convert_and_assign_attributes(properties)
|
15
15
|
end
|
16
|
+
|
17
|
+
def init_on_reload(reloaded)
|
18
|
+
@attributes = nil
|
19
|
+
init_on_load(reloaded, reloaded.props)
|
20
|
+
end
|
16
21
|
end
|
@@ -15,5 +15,14 @@ module Neo4j::ActiveRel
|
|
15
15
|
@attributes = convert_and_assign_attributes(persisted_rel.props)
|
16
16
|
load_nodes(from_node_id, to_node_id)
|
17
17
|
end
|
18
|
+
|
19
|
+
def init_on_reload(unwrapped_reloaded)
|
20
|
+
@attributes = nil
|
21
|
+
init_on_load(unwrapped_reloaded,
|
22
|
+
unwrapped_reloaded._start_node_id,
|
23
|
+
unwrapped_reloaded._end_node_id,
|
24
|
+
unwrapped_reloaded.rel_type)
|
25
|
+
self
|
26
|
+
end
|
18
27
|
end
|
19
28
|
end
|
@@ -137,11 +137,8 @@ module Neo4j::Shared
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def reload_from_database
|
140
|
-
|
141
|
-
|
142
|
-
send(:attributes=, reloaded.attributes)
|
143
|
-
end
|
144
|
-
reloaded
|
140
|
+
reloaded = self.class.load_entity(neo_id)
|
141
|
+
reloaded ? init_on_reload(reloaded._persisted_obj) : nil
|
145
142
|
end
|
146
143
|
|
147
144
|
# Updates this resource with all the attributes from the passed-in Hash and requests that the record be saved.
|
@@ -53,6 +53,11 @@ module Neo4j::Shared
|
|
53
53
|
hash.each { |key, value| send("#{key}=", value) }
|
54
54
|
end
|
55
55
|
|
56
|
+
def reload_properties!(properties)
|
57
|
+
@attributes = nil
|
58
|
+
convert_and_assign_attributes(properties)
|
59
|
+
end
|
60
|
+
|
56
61
|
protected
|
57
62
|
|
58
63
|
# This method is defined in ActiveModel.
|
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: 6.0.
|
4
|
+
version: 6.0.4
|
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-12-
|
11
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|