Callbacks¶
nodoc: |
---|
Constants¶
Methods¶
- #conditional_callback
Allows you to perform a callback if a condition is not satisfied.
def conditional_callback(kind, guard) return yield if guard run_callbacks(kind) { yield } end
- #destroy
nodoc: def destroy #:nodoc: tx = Neo4j::Transaction.new run_callbacks(:destroy) { super } rescue @_deleted = false @attributes = @attributes.dup tx.mark_failed raise ensure tx.close if tx end
#initialize
def initialize(args = nil) run_callbacks(:initialize) { super } end
#save
def save(*args) unless _persisted_obj || (from_node.respond_to?(:neo_id) && to_node.respond_to?(:neo_id)) fail Neo4j::ActiveRel::Persistence::RelInvalidError, 'from_node and to_node must be node objects' end super(*args) end
- #touch
nodoc: def touch #:nodoc: run_callbacks(:touch) { super } end