Skip to content

Latest commit

 

History

History
93 lines (44 loc) · 1.13 KB

Callbacks.rst

File metadata and controls

93 lines (44 loc) · 1.13 KB

Callbacks

nodoc

Constants

Files

Methods

#destroy
nodoc

ruby

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

#save

ruby

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

ruby

def touch(*) #:nodoc:

run_callbacks(:touch) { super }

end