Module: ActiveCypher

Defined in:
lib/activecypher.rb,
lib/active_cypher/base.rb,
lib/active_cypher/bolt.rb,
lib/active_cypher/logging.rb,
lib/active_cypher/railtie.rb,
lib/active_cypher/scoping.rb,
lib/active_cypher/version.rb,
lib/active_cypher/fixtures.rb,
lib/active_cypher/migrator.rb,
lib/active_cypher/relation.rb,
lib/active_cypher/migration.rb,
lib/active_cypher/redaction.rb,
lib/active_cypher/model/core.rb,
lib/active_cypher/bolt/driver.rb,
lib/active_cypher/bolt/result.rb,
lib/active_cypher/associations.rb,
lib/active_cypher/bolt/session.rb,
lib/active_cypher/relationship.rb,
lib/active_cypher/utils/logger.rb,
lib/active_cypher/bolt/handlers.rb,
lib/active_cypher/cypher_config.rb,
lib/active_cypher/schema/dumper.rb,
lib/active_cypher/bolt/messaging.rb,
lib/active_cypher/model/abstract.rb,
lib/active_cypher/model/querying.rb,
lib/active_cypher/schema/catalog.rb,
lib/active_cypher/bolt/connection.rb,
lib/active_cypher/bolt/packstream.rb,
lib/active_cypher/connection_pool.rb,
lib/active_cypher/fixtures/parser.rb,
lib/active_cypher/instrumentation.rb,
lib/active_cypher/model/callbacks.rb,
lib/active_cypher/model/countable.rb,
lib/active_cypher/model/labelling.rb,
lib/active_cypher/bolt/transaction.rb,
lib/active_cypher/model/attributes.rb,
lib/active_cypher/runtime_registry.rb,
lib/active_cypher/fixtures/registry.rb,
lib/active_cypher/model/destruction.rb,
lib/active_cypher/model/persistence.rb,
lib/active_cypher/connection_handler.rb,
lib/active_cypher/fixtures/evaluator.rb,
lib/active_cypher/bolt/message_reader.rb,
lib/active_cypher/bolt/message_writer.rb,
lib/active_cypher/fixtures/dsl_context.rb,
lib/active_cypher/fixtures/rel_builder.rb,
lib/active_cypher/schema/writer/cypher.rb,
lib/active_cypher/bolt/version_encoding.rb,
lib/active_cypher/fixtures/node_builder.rb,
lib/active_cypher/model/connection_owner.rb,
lib/active_cypher/connection_url_resolver.rb,
lib/active_cypher/generators/node_generator.rb,
lib/active_cypher/model/connection_handling.rb,
lib/active_cypher/connection_adapters/registry.rb,
lib/active_cypher/generators/install_generator.rb,
lib/active_cypher/associations/collection_proxy.rb,
lib/active_cypher/generators/migration_generator.rb,
lib/active_cypher/connection_adapters/neo4j_adapter.rb,
lib/active_cypher/generators/relationship_generator.rb,
lib/active_cypher/connection_adapters/abstract_adapter.rb,
lib/active_cypher/connection_adapters/memgraph_adapter.rb,
lib/active_cypher/connection_adapters/persistence_methods.rb,
lib/active_cypher/connection_adapters/abstract_bolt_adapter.rb

Overview

Adds ‘self.abstract_class = true` support, mimicking ActiveRecord’s approach to abstract base classes. No runtime enforcement—just vibes, a sprinkle of Ruby sorcery, and the hope you know what you’re doing. Because nothing says “enterprise” like a flag that means “please ignore me.”

This module gives every subclass an ‘abstract_class` boolean, along with the `abstract_class?` reader. You can assign this flag in your base class to signal “do not instantiate me,” like a digital “Do Not Resuscitate” order. It’s the ORM equivalent of a velvet rope at a nightclub, or a protective circle against accidental instantiation.

Example

class ApplicationGraphNode < ActiveCypher::Base
  self.abstract_class = true
end

class PersonNode < ApplicationGraphNode
  attribute :name, :string
end

ApplicationGraphNode.abstract_class?  # => true
PersonNode.abstract_class?            # => false

Querying an abstract class will raise a runtime error—eventually. Maybe. Down in the adapter layer where your dreams go to die. Or at least where your stacktraces go to get longer. If only you had a talisman against such errors—perhaps.

Defined Under Namespace

Modules: Associations, Bolt, ConnectionAdapters, CypherConfig, Fixtures, Generators, Instrumentation, Logging, Model, Redaction, RuntimeRegistry, Schema, Scoping, Utils Classes: AbstractClassError, AdapterLoadError, AdapterNotFoundError, AssociationError, AssociationTypeMismatch, Base, ConfigurationError, ConnectionError, ConnectionHandler, ConnectionNotEstablished, ConnectionPool, ConnectionTimeoutError, ConnectionUrlResolver, CypherSyntaxError, Error, HasManyThroughError, Migration, Migrator, PersistenceError, ProtocolError, QueryError, Railtie, RecordNotDestroyed, RecordNotFound, RecordNotSaved, Relation, Relationship, TransactionError, UnknownConnectionError, UnknownEnvironmentError, ValidationError

Constant Summary collapse

VERSION =
'0.11.2'

Class Method Summary collapse

Class Method Details

.gem_versionObject Also known as: version



6
7
8
# File 'lib/active_cypher/version.rb', line 6

def self.gem_version
  Gem::Version.new VERSION
end