neo4j 5.2.12 → 5.2.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba0002527f91ae9a9239543daf3349cafe86e8b8
4
- data.tar.gz: 51fe8a0c9808b2426eae849ad1d58d638627b920
3
+ metadata.gz: abf8d81e7dc5232e07dda9796367061233e4716e
4
+ data.tar.gz: b7e00df2c8d8a10ef2fb1a148d53b17c36990879
5
5
  SHA512:
6
- metadata.gz: e75e90ce930902118cbef07996a902ccbf1251aca97b9d45e1f4653e86289b38ea9a9d8cd5a9f02d8dab542c45aa8aeddb2c6302b38a9918a5f3f30033371894
7
- data.tar.gz: 2d88e7fa12b4fce00455299a45fec336c75663d67f5b0d580b4dfebad07d8f7be9585cb84fc9d129f0e05079a4c50d38868792737a21e845375770a30f0d85f0
6
+ metadata.gz: 5278a649bb303704ed2205671dd68712a688082290791e82a65a8bf6143ad0c1d7883078f003825944bf426cc0ba4e4b826d7fce602421fae105f34f69acfdfd
7
+ data.tar.gz: a44d10311b87b63ff3a85ddcdc8faa4fee4a9a815580140cfdcff2db8bb47777e9867ae664fa09cd24ca911f5cc8c31fe49aa5e3b62a904f8645570aef2d8106
@@ -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
- ## [Unreleased][unreleased]
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(*) #:nodoc:
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 "Cannot touch on a new record object" unless persisted?
87
- update_attribute(:updated_at, Time.now) if attributes.key?('updated_at')
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
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '5.2.12'
2
+ VERSION = '5.2.13'
3
3
  end
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.12
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-25 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orm_adapter