neo4jrb/activegraph
60.0
Adequate · 19 September 2026
9.7k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
ActiveGraph is a Ruby gem that provides an Object-Relational Mapping (ORM) layer for Neo4j, enabling Ruby applications to interact with the graph database using familiar model-based patterns. It supports defining nodes and relationships with properties, associations, and validations, while handling Cypher query generation and execution through a native driver. The system includes a migration framework for managing schema changes, automatic timestamping, and integration with Rails via generators and rake tasks.
How it got here
2008–2014 — ActiveGraph library rewrite and test suite
12 changes.
The project underwent a significant architectural shift by renaming the Neo4j library to ActiveGraph and replacing its legacy JRuby implementation with a native Ruby driver integration. This period focused on establishing the new gem structure and dependencies while comprehensively validating the core functionality through extensive unit, integration, and end-to-end test suites.
2015–2024 — ActiveGraph 12.0.0 release and migration framework
20 changes.
This period centered on the ActiveGraph 12.0.0 release, which introduced a native driver, explicit transaction management, and a comprehensive new migration system with schema synchronization. The work involved restructuring the core library into modular components for nodes, relationships, and schema operations, while adding Rails generators to support these new features. Extensive test coverage was added across unit, integration, and end-to-end levels to validate the new architecture and ensure stability.
Features
Added bin/rake binstub
A new binstub for the Rake command-line tool has been added to the bin directory. This file facilitates running Rake as part of the local bundle, ensuring that the correct version of the gem is used by setting up the Bundler environment and loading the executable from the installed gem.
bin · high confidence
Added schema operation classes and timestamp mixins
This change introduces new files for managing database schema operations and automatic timestamps. The \lib/active\_graph/schema/operation.rb\ file adds an abstract \Operation\ class along with concrete implementations for creating and dropping exact indexes (\ExactIndexOperation\) and unique constraints (\UniqueConstraintOperation\), handling incompatibilities between them. Additionally, \lib/active\_graph/timestamps/created.rb\ and \lib/active\_graph/timestamps/updated.rb\ add mixins that automatically include \created\_at\ and \updated\_at\ properties on nodes, respectively.
_lib/active\_graph/schema, lib/active\graph/timestamps · high confidence
New Rails generators for models, migrations, and schema upgrades
Active Graph now provides built-in Rails generators to scaffold application components. Users can generate model files with configurable properties, relationships (has\_one/has\_many), indices, and timestamps, along with corresponding Neo4j migration files that handle UUID constraints. A dedicated generator is also included to create migration scripts for upgrading the database schema from version 8, automating the addition and removal of indexes and constraints based on the current model definitions.
lib/rails · high confidence
Behavioural changes
ActiveGraph 12.0.0 release with native driver and transaction support
ActiveGraph has been updated to version 12.0.0, introducing a native driver implementation that replaces the previous driver layer. This change brings explicit session and transaction management capabilities, allowing users to use \write\_transaction\, \read\_transaction\, and \session\ methods for better control over database operations. The release also includes a new ANSI module for colored console output, a refactored \AttributeSet\ class for handling model attributes, and updated migration helpers for managing ID properties and relationship styles. Additionally, the library now supports UUID generation with proper UTF-8 encoding and includes a new \Paginated\ class for handling query results.
_lib/active\graph · high confidence
ActiveGraph core library restructured with new Cypher error handling and schema management
The core library has been reorganized into a new modular structure, introducing dedicated classes for Cypher error handling (CypherError and specific schema errors like ConstraintValidationFailedError) to provide detailed error codes and stack traces. Schema management is now handled through a new Element base class and its Label and Type subclasses, which implement methods for creating and dropping indexes and constraints using Neo4j's native Cypher commands. The query execution layer has been refactored with new modules for instrumentation (Instrumentable) and logging (Logging), integrating with ActiveSupport::Notifications to capture Bolt request and Cypher query events. Additionally, the library now includes native Result and Record wrappers to handle data wrapping and streaming, and a new Schema module to introspect database version, edition, and existing indexes/constraints.
_lib/active\graph/core · high confidence
Adopts Conventional Commits and git-cliff for automated changelog generation
The project now enforces Conventional Commits for all new commits and PR titles, with a new \rake changelog\ task that automatically generates the \\[Unreleased\]\ section of \CHANGELOG.md\ using \git-cliff\. This replaces the previous manual changelog maintenance, ensuring that only user-facing changes (features, fixes, performance improvements) are included in the release notes while excluding internal chores, CI, docs, and refactors. The configuration is defined in \cliff.toml\ and integrated into the development workflow via \CLAUDE.md\ conventions.
(repo-wide) · high confidence
Library renamed from Neo4j to ActiveGraph with new driver integration
The library has been renamed from Neo4j to ActiveGraph, replacing the legacy JRuby-based implementation in lib/main.rb with a new Ruby-native driver integration in lib/active\_graph.rb. This change updates the core module structure to use the neo4j-ruby-driver, prepending ActiveGraph modules to the driver's Result, Record, Transaction, and Entity classes to provide native Ruby object wrapping and behavior.
lib · high confidence
New ActiveGraph migration system with transaction control and schema synchronization
The library introduces a new migration framework under the \ActiveGraph::Migrations\ namespace, replacing the previous implementation. This new system provides a \Base\ migration class that supports optional transaction wrapping (with a \disable\_transactions!\ helper for operations that cannot run in transactions, such as schema modifications) and tracks migration status via a \SchemaMigration\ node. It includes a \Runner\ for executing pending migrations, handling incomplete states, and reporting status, as well as a \CheckPending\ middleware for development environments. Additionally, a \Schema\ helper module is added to synchronize database constraints and indexes between the application definition and the database, ensuring schema consistency.
_lib/active\graph/migrations · high confidence
New migration rake tasks and schema load compatibility fix
This change introduces a new \lib/active\_graph/tasks/migration.rake\ file that provides Rake tasks for managing database migrations, including \neo4j:migrate:all\, \up\, \down\, \status\, \rollback\, and \resolve\, as well as schema dump and load operations. It also updates the \neo4j:schema:load\ task to handle compatibility with Psych version 4.0.1 and later by using \YAML.safe\_load\ with \permitted\_classes: \[Symbol\]\, ensuring schema files load correctly on newer Ruby versions.
_lib/active\graph/tasks · high confidence
Refactor to ActiveGraph shared modules
The library has been refactored to use the ActiveGraph namespace, consolidating core model behaviors into shared modules. This change introduces dedicated modules for managing attributes, callbacks, Cypher query generation, and property declarations, while also adding support for enums, mass assignment, and relationship-specific type converters. These shared components provide the foundational behavior for nodes and relationships within the ActiveGraph framework.
_lib/active\graph/shared · high confidence
Refactored node architecture with modular components and UUID support
The node implementation has been restructured into a modular set of files (callbacks, dependent handling, enums, has\_n associations, id properties, persistence, etc.) to improve maintainability. A key behavioral change is the introduction of the \id\_property\ feature, allowing models to use custom identifiers (such as auto-generated UUIDs) instead of the default Neo4j internal ID, which also updates how records are found and indexed. Additionally, the \has\_n\ association logic has been refined with dedicated modules for dependent actions (delete, destroy, orphans) and relationship factory/wrapper classes, ensuring more robust handling of cascading deletes and relationship creation.
_lib/active\graph/node · high confidence
Relationship persistence and querying behavior updated for ActiveGraph
The relationship module has been refactored to improve persistence reliability and query clarity. Saving a relationship now strictly requires both \from\_node\ and \to\_node\ to be valid node objects, raising a \RelInvalidError\ if this precondition is not met. The \find\ method on relationship classes now accepts a standard \id\ (mapped to the \neo\_id\ property) rather than the legacy \neo\_id\ argument, and queries use the relationship's mapped element name for precise matching. Additionally, a new \RelatedNode\ wrapper enables lazy loading of associated nodes, ensuring that relationship queries do not trigger unnecessary database loads for node data until explicitly accessed.
_lib/active\graph/relationship · high confidence
Test coverage
Added custom RSpec matcher for validating model errors; Added end-to-end test suite for ActiveGraph core features; Added end-to-end tests for model and migration generators; Added integration tests for node label management and querying; Added integration tests for the ActiveGraph ORM adapter; Added integration tests for type converters; Added shared examples for schema operation interface; Added shared test suites for model lifecycle and behavior; Added test coverage for ActiveGraph base queries and transaction handling; Added test suite for ActiveGraph core and relationship persistence; Added tests for the shared QueryFactory; Added unit tests for ActiveGraph Node module components; Added unit tests for ActiveGraph core components; Added unit tests for HasN association wrappers and Cypher generation; Added unit tests for migration helpers and schema synchronization; Added unit tests for query parameter handling and proxy iteration; Added unit tests for relationship modules; Added unit tests for schema operation classes; Added unit tests for shared ActiveGraph property and attribute modules.
Dependencies
Initial gemspec and Gemfile for ActiveGraph
The project now includes an \activegraph.gemspec\ and a \Gemfile\ to define its structure and dependencies. The gem requires Ruby 3.4 or higher and declares runtime dependencies on \activemodel\, \benchmark\, \i18n\ (excluding version 1.8.8), \neo4j-ruby-driver\ (version 6.2.1), and \orm\_adapter\ (version 0.5.0 or higher). Development dependencies include testing tools like RSpec, Guard, Rubocop, and coverage reporters, as well as \railties\ for Rails integration testing.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 60.
Lenses
- Code Health 95
- Architecture 93
- Maturity 51
- Readiness 58
- Security 66
Changes since last survey
- 300 commits — 247 feature/other, 53 fixes
By area
- (root) — 80 commits
- lib/active_graph — 74 commits
- lib/neo4j — 40 commits
- (repo) — 34 commits
- .github/workflows — 34 commits
- spec/e2e — 13 commits
- spec/active_graph — 5 commits
- docs/Setup.rst — 4 commits
- docs/activegraph.rb — 4 commits
- spec/unit — 4 commits
- docs/Configuration.rst — 3 commits
- docs/UpgradeGuide.rst — 2 commits
- config/neo4j — 1 commit
- lib/rails — 1 commit
- spec/neo4j — 1 commit
Notable commits
- fix: Add psych as dependency and fix schema load on psych >= 4.0.1 (#1685)
- fix: Fix errors in example code
- fix: Fix for with_associations eager loading issue with relationship on same model (#1598)
- fix: Fix single rel caching issue (#1713)
- fix: Fixed type in UpgradeGuide
- fix: Fixed warnings of mentioning specific exceptions in rspec
- fix: Fixes Schema Synchronzation for at least neo4j >= 4.3 (#1683)
- fix: Fixes lost @rel_var when branching QueryProxy (#1677)
- fix: Fixes to support compatibility with Rails 6
- fix: Issue 1576 Fix for duplicate nodes with deep with_associations (#1577)
- fix: Issue-1611 Fix in updating relations with ids
- fix: Merge pull request #1559 from lshimokawa/fix-remove-property
- fix: Spelling fix (#1694)
- fix: Travis build failure fix
- fix: Travis build failure fix
- fix: Typo fix
- fix: Zeitwerk autoload fixes (#1709)
- fix: [fix] Move ActiveGraph::Migrations runner into separated transaction (#1673)
- fix: bug fixes
- fix: bug fixes
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
neo4jrb/activegraph was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f6b9a0e4c7fb22b996c7985b1aecc9e32682fe2f — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.