lib/neo4j/shared/callbacks.rb in neo4j-5.2.12 vs lib/neo4j/shared/callbacks.rb in neo4j-5.2.13

- old
+ new

@@ -7,14 +7,19 @@ include ActiveModel::Callbacks end included do include ActiveModel::Validations::Callbacks + # after_find is triggered by the `find` method defined in lib/neo4j/active_node/id_property.rb define_model_callbacks :initialize, :find, only: :after define_model_callbacks :save, :create, :update, :destroy, :touch end + def initialize(args = nil) + run_callbacks(:initialize) { super } + end + def destroy #:nodoc: tx = Neo4j::Transaction.new run_callbacks(:destroy) { super } rescue @_deleted = false @@ -23,10 +28,10 @@ raise ensure tx.close if tx end - def touch(*) #:nodoc: + def touch #:nodoc: run_callbacks(:touch) { super } end private