neo4j 5.2.12 → 5.2.13
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 -1
- data/lib/neo4j/active_node/labels.rb +12 -1
- data/lib/neo4j/shared/callbacks.rb +6 -1
- data/lib/neo4j/shared/persistence.rb +2 -2
- 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: abf8d81e7dc5232e07dda9796367061233e4716e
|
4
|
+
data.tar.gz: b7e00df2c8d8a10ef2fb1a148d53b17c36990879
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5278a649bb303704ed2205671dd68712a688082290791e82a65a8bf6143ad0c1d7883078f003825944bf426cc0ba4e4b826d7fce602421fae105f34f69acfdfd
|
7
|
+
data.tar.gz: a44d10311b87b63ff3a85ddcdc8faa4fee4a9a815580140cfdcff2db8bb47777e9867ae664fa09cd24ca911f5cc8c31fe49aa5e3b62a904f8645570aef2d8106
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,11 @@ 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
|
+
## [5.2.13] - 10-26-2015
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
- Fixed `#after_initialize` and `#after_find` callbacks.
|
10
|
+
- The `#touch` method should to raise errors when unsuccessful and avoid `#attributes` for performance.
|
7
11
|
|
8
12
|
## [5.2.12] - 10-25-2015
|
9
13
|
|
@@ -90,7 +90,7 @@ module Neo4j
|
|
90
90
|
find_by_id(map_id.call(id))
|
91
91
|
end
|
92
92
|
fail Neo4j::RecordNotFound if result.blank?
|
93
|
-
result
|
93
|
+
result.tap { |r| find_callbacks!(r) }
|
94
94
|
end
|
95
95
|
|
96
96
|
# Finds the first record matching the specified conditions. There is no implied ordering so if order matters, you should specify it yourself.
|
@@ -247,6 +247,17 @@ module Neo4j
|
|
247
247
|
|
248
248
|
private
|
249
249
|
|
250
|
+
def find_callbacks!(result)
|
251
|
+
case result
|
252
|
+
when Neo4j::ActiveNode
|
253
|
+
result.run_callbacks(:find)
|
254
|
+
when Array
|
255
|
+
result.each { |r| find_callbacks!(r) }
|
256
|
+
else
|
257
|
+
result
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
250
261
|
def label_for_model
|
251
262
|
(self.name.nil? ? object_id.to_s.to_sym : decorated_label_name)
|
252
263
|
end
|
@@ -9,10 +9,15 @@ module Neo4j
|
|
9
9
|
|
10
10
|
included do
|
11
11
|
include ActiveModel::Validations::Callbacks
|
12
|
+
# after_find is triggered by the `find` method defined in lib/neo4j/active_node/id_property.rb
|
12
13
|
define_model_callbacks :initialize, :find, only: :after
|
13
14
|
define_model_callbacks :save, :create, :update, :destroy, :touch
|
14
15
|
end
|
15
16
|
|
17
|
+
def initialize(args = nil)
|
18
|
+
run_callbacks(:initialize) { super }
|
19
|
+
end
|
20
|
+
|
16
21
|
def destroy #:nodoc:
|
17
22
|
tx = Neo4j::Transaction.new
|
18
23
|
run_callbacks(:destroy) { super }
|
@@ -25,7 +30,7 @@ module Neo4j
|
|
25
30
|
tx.close if tx
|
26
31
|
end
|
27
32
|
|
28
|
-
def touch
|
33
|
+
def touch #:nodoc:
|
29
34
|
run_callbacks(:touch) { super }
|
30
35
|
end
|
31
36
|
|
@@ -83,8 +83,8 @@ module Neo4j::Shared
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def touch
|
86
|
-
fail
|
87
|
-
update_attribute(:updated_at, Time.now) if
|
86
|
+
fail 'Cannot touch on a new record object' unless persisted?
|
87
|
+
update_attribute!(:updated_at, Time.now) if respond_to?(:updated_at=)
|
88
88
|
end
|
89
89
|
|
90
90
|
# Returns +true+ if the record is persisted, i.e. it's not a new record and it was not destroyed
|
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.13
|
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-10-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|