Class: Neo4j::Rails::Model
- Inherits:
-
Object
- Object
- Neo4j::Rails::Model
- Extended by:
- ActiveModel::Translation, OrmAdapter::ToAdapter
- Includes:
- ActiveModel::Dirty, ActiveModel::MassAssignmentSecurity, ActiveModel::Observing, NodeMixin, AcceptId, Attributes, Callbacks, Compositions, Finders, HasN, Identity, NestedAttributes, NodePersistence, Persistence, Relationships, Serialization, Timestamps, Validations
- Defined in:
- lib/neo4j/rails/model.rb,
lib/orm_adapter/adapters/neo4j.rb
Overview
Makes Neo4j nodes and relationships behave like active record objects. That means for example that you don't (normally) have to care about transactions since they will be automatically be created when needed. Validation, Callbacks etc. are also supported.
Class Method Modules
-
Persistence::ClassMethods defines methods like: create and destroy_all
-
Attributes::ClassMethods defines the property and columns methods.
-
NestedAttributes::ClassMethods defines accepts_nested_attributes_for
-
HasN::ClassMethods defines has_n and has_one
-
Finders::ClassMethods defines find
-
Compositions::ClassMethods defines composed_of method
-
AcceptId::ClassMethods defines accepts_id_for method.
Defined Under Namespace
Classes: OrmAdapter
Constant Summary
Constant Summary
Constants included from Timestamps
Timestamps::TIMESTAMP_PROPERTIES
Constants included from Callbacks
Class Method Summary (collapse)
-
+ (Object) default_timezone
Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database.
- + (Object) default_timezone=(zone)
-
+ (Symbol) i18n_scope
Set the i18n scope to overwrite ActiveModel.
Methods included from Compositions
#clear_composition_cache, #composition_cache
Methods included from Relationships
#_incoming, #_outgoing, #incoming, #node, #nodes, #outgoing, #rel, #rel?, #rels
Methods included from Timestamps
#create_timestamp, #new_or_changed?, #update_timestamp, #write_date_or_timestamp
Methods included from Callbacks
#destroy_with_callbacks, #valid_with_callbacks?
Methods included from Validations
#read_attribute_for_validation, #save, #valid?
Methods included from NestedAttributes
Methods included from TxMethods
Methods included from Attributes
#_classname, #attribute?, #attribute_defaults, #attribute_names, #attributes, #attributes=, #hash, #property?, #property_changed?, #property_names, #props, #read_attribute, #read_attribute_with_type_conversion, #to_key, #to_model, #to_param, #update_attribute, #update_attributes, #update_attributes!, #write_attribute, #write_attribute_with_type_conversion
Methods included from NodePersistence
#create, #freeze_if_deleted, #initialize, #reload, #reload_from_database, #update
Methods included from Persistence
#create_or_updating?, #delete, #destroy, #destroyed?, #freeze, #frozen?, #new_record?, #persisted?, #save, #save!
Methods included from Identity
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Neo4j::Rails::Attributes
Class Method Details
+ (Object) default_timezone
Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. This is set to :local by default.
133 134 135 |
# File 'lib/neo4j/rails/model.rb', line 133 def default_timezone @default_timezone || :local end |
+ (Object) default_timezone=(zone)
138 139 140 |
# File 'lib/neo4j/rails/model.rb', line 138 def default_timezone=(zone) @default_timezone = zone end |
+ (Symbol) i18n_scope
Set the i18n scope to overwrite ActiveModel.
146 147 148 |
# File 'lib/neo4j/rails/model.rb', line 146 def i18n_scope :neo4j end |