ActiveNode

Makes Neo4j nodes and relationships behave like ActiveRecord objects. By including this module in your class it will create a mapping for the node to your ruby class by using a Neo4j Label with the same name as the class. When the node is loaded from the database it will check if there is a ruby class for the labels it has. If there Ruby class with the same name as the label then the Neo4j node will be wrapped in a new object of that class.

= ClassMethods * {Neo4j::ActiveNode::Labels::ClassMethods} defines methods like: <tt>index</tt> and <tt>find</tt> * {Neo4j::ActiveNode::Persistence::ClassMethods} defines methods like: <tt>create</tt> and <tt>create!</tt> * {Neo4j::ActiveNode::Property::ClassMethods} defines methods like: <tt>property</tt>.

Constants

  • WRAPPED_CLASSES
  • MODELS_FOR_LABELS_CACHE
  • USES_CLASSNAME

Methods

#==

+ show/hide code
#[]

Returning nil when we get ActiveAttr::UnknownAttributeError from ActiveAttr

+ show/hide code

#_active_record_destroyed_behavior?

+ show/hide code

#_create_node

+ show/hide code
#_destroyed_double_check?

These two methods should be removed in 6.0.0

+ show/hide code
#_persisted_obj

Returns the value of attribute _persisted_obj

+ show/hide code

#_rels_delegator

+ show/hide code
#add_label

adds one or more labels

+ show/hide code

#apply_default_values

+ show/hide code
#as

Starts a new QueryProxy with the starting identifier set to the given argument and QueryProxy source_object set to the node instance. This method does not exist within QueryProxy and can only be used to start a new chain.

+ show/hide code

#association_proxy

+ show/hide code
#association_proxy_cache

Returns the current AssociationProxy cache for the association cache. It is in the format { :association_name => AssociationProxy} This is so that we * don’t need to re-build the QueryProxy objects * also because the QueryProxy object caches it’s results * so we don’t need to query again * so that we can cache results from association calls or eager loading

+ show/hide code

#association_proxy_cache_fetch

+ show/hide code

#association_query_proxy

+ show/hide code

#cache_key

+ show/hide code
#called_by

Returns the value of attribute called_by

+ show/hide code
#called_by=

Sets the attribute called_by

+ show/hide code

#declared_property_manager

+ show/hide code

#default_properties

+ show/hide code

#default_properties=

+ show/hide code

#default_property

+ show/hide code

#dependent_children

+ show/hide code
#destroy
nodoc:
+ show/hide code
#destroyed?

Returns +true+ if the object was destroyed.

+ show/hide code

#eql?

+ show/hide code

#exist?

+ show/hide code

#freeze

+ show/hide code

#frozen?

+ show/hide code

#hash

+ show/hide code

#id

+ show/hide code
#init_on_load

called when loading the node from the database

+ show/hide code

#initialize

+ show/hide code

#inspect

+ show/hide code

#labels

+ show/hide code

#neo4j_obj

+ show/hide code

#neo_id

+ show/hide code
#new?

Returns +true+ if the record hasn’t been saved to Neo4j yet.

+ show/hide code
#new_record?

Returns +true+ if the record hasn’t been saved to Neo4j yet.

+ show/hide code
#persisted?

Returns +true+ if the record is persisted, i.e. it’s not a new record and it was not destroyed

+ show/hide code

#props

+ show/hide code
#query_as

Returns a Query object with the current node matched the specified variable name

+ show/hide code
#read_attribute

Returning nil when we get ActiveAttr::UnknownAttributeError from ActiveAttr

+ show/hide code
#read_attribute_for_validation

Implements the ActiveModel::Validation hook method.

+ show/hide code

#reload

+ show/hide code

#reload_from_database

+ show/hide code
#remove_label

Removes one or more labels Be careful, don’t remove the label representing the Ruby class.

+ show/hide code
#save

The validation process on save can be skipped by passing false. The regular Model#save method is replaced with this when the validations module is mixed in, which it is by default.

+ show/hide code
#save!

Persist the object to the database. Validations and Callbacks are included by default but validation can be disabled by passing :validate => false to #save! Creates a new transaction.

+ show/hide code

#send_props

+ show/hide code

#serializable_hash

+ show/hide code

#serialized_properties

+ show/hide code
#to_key

Returns an Enumerable of all (primary) key attributes or nil if model.persisted? is false

+ show/hide code
#touch
nodoc:
+ show/hide code
#update

Updates this resource with all the attributes from the passed-in Hash and requests that the record be saved. If saving fails because the resource is invalid then false will be returned.

+ show/hide code
#update!

Same as {#update_attributes}, but raises an exception if saving fails.

+ show/hide code
#update_attribute

Convenience method to set attribute and #save at the same time

+ show/hide code
#update_attribute!

Convenience method to set attribute and #save! at the same time

+ show/hide code
#update_attributes

Updates this resource with all the attributes from the passed-in Hash and requests that the record be saved. If saving fails because the resource is invalid then false will be returned.

+ show/hide code
#update_attributes!

Same as {#update_attributes}, but raises an exception if saving fails.

+ show/hide code

#valid?

+ show/hide code
#wrapper

Implements the Neo4j::Node#wrapper and Neo4j::Relationship#wrapper method so that we don’t have to care if the node is wrapped or not.

+ show/hide code