salsify/goldiloader
68.4
Adequate · 19 September 2026
591
lines of production code
Ruby
primary language
1
measurement over time
What this system is
Goldiloader is a Ruby gem that automatically eager loads ActiveRecord associations to prevent N+1 query issues. It provides global configuration and thread-safe toggles to control this behavior, along with custom preload capabilities and options for forcing immediate loading. The system is designed to integrate with modern Rails versions, ensuring compatibility through extensive testing and benchmarking infrastructure.
Features
Initial release of Goldiloader for automatic association loading
Goldiloader is introduced as a new library that automatically eager loads ActiveRecord associations to prevent N+1 query issues. It provides a global configuration flag to enable or disable this behavior and offers thread-safe, block-based methods (\enabled\ and \disabled\) to temporarily toggle automatic loading within specific code sections without affecting other threads.
lib · high confidence
Behavioural changes
Benchmark suite now runs in forked processes to isolate memory state
The benchmark infrastructure has been refactored to execute test blocks in forked child processes via a new \ExperimentServer\ and \ForkingBenchmark\ adapter. This change ensures that each benchmark iteration starts with a clean, isolated memory state, preventing data leakage or state accumulation between runs. The suite now includes specific benchmarks for comparing ActiveRecord eager loading against Goldiloader for both single-model associations and multi-model scenarios.
benchmark · high confidence
Goldiloader 6.0.0: Custom preloads, fully\_load option, and Rails 8.0 support
Goldiloader has been updated to version 6.0.0, introducing support for Rails 8.0 and Ruby 4.0. This release adds a new \fully\_load\ association option that forces immediate loading of association data, and introduces custom preloads via the \goldiload\ method on relations, allowing users to define and cache custom queries for multiple models. The library also refactors its internal patching strategy to use \Module\#prepend\ instead of \alias\_method\_chain\ for better compatibility with modern Ruby and Rails versions, and drops support for older Ruby and Rails versions.
lib/goldiloader · high confidence
Goldiloader 6.0.0: Support for Rails 8.1 and Ruby 3.4
This release updates the library to support Rails 8.1 and Ruby 3.4, while dropping support for older versions including Rails 6.1, 7.0, 7.1, and Ruby 3.0, 3.1. The test matrix has been expanded to include Rails 7.2, 8.0, 8.1, and the Rails edge (main branch), ensuring compatibility with the latest ActiveRecord versions. Additionally, the project configuration has been updated to target Ruby 3.2 as the minimum version for development and linting via RuboCop.
(repo-wide) · high confidence
Refactored auto-include context and added benchmark schema
The library introduces a dedicated \AutoIncludeContext\ class to manage the state of models being auto-included, replacing the previous inline context handling. This change includes a fix to prevent infinite recursion when accessing \ActiveStorage::Attachment\#blob\ by avoiding \Array.wrap\ on model collections during registration. Additionally, a new \ScopeInfo\ helper class is added to inspect ActiveRecord scope properties (such as limit, offset, and ordering), and a benchmark schema is included to support performance testing of these optimizations.
goldiloader · high confidence
Test coverage
Add RSpec test infrastructure with query-expectation matcher; Added database schema and model definitions for test suite; Added internal Rails test application scaffolding; Added test coverage for Goldiloader's auto-include context and core eager-loading behaviors.
Dependencies
Added Gemfiles for Rails 7.2, 8.0, 8.1, and Edge testing
The project now includes dedicated Appraisal gemfiles to support testing against Rails 7.2.3, 8.0.4, 8.1.2, and the Rails main branch (edge). These files explicitly pin the \activerecord\, \activesupport\, and \rails\ gems to their respective versions, enabling the library to verify compatibility with these newer Rails releases.
gemfiles · high confidence
Initial release of Goldiloader gem with Rails 7.2+ support
This change introduces the Goldiloader gem, which automatically eager loads Rails associations as they are traversed. The gem is configured to require Ruby 3.2 or higher and supports ActiveRecord and ActiveSupport versions 7.2 through 8.2. Development dependencies include testing tools like RSpec, Combustion, and SQLite3.
(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 68.
Lenses
- Code Health 100
- Architecture 69
- Maturity 59
- Readiness 70
- Security 93
- Domain Modelling 100
Changes since last survey
- 205 commits — 169 feature/other, 36 fixes
By area
- (root) — 126 commits
- lib/goldiloader — 55 commits
- (repo) — 15 commits
- .circleci/config.yml — 3 commits
- spec/goldiloader — 2 commits
- .github/CODEOWNERS — 1 commit
- benchmark/lib — 1 commit
- lib/goldiloader.rb — 1 commit
- spec/internal — 1 commit
Notable commits
- fix: Fix build failure from new sqlite version (#84)
- fix: Enable eager loading of associations with a from in Rails 5.0.x >= 5.0.7 and Rails >= 5.1.5 because the underlying Rails bug has been fixed. (#69)
- fix: Enable eager loading of associations with a group in Rails 5.0.x >= 5.0.7 and Rails >= 5.1.5 because the underlying Rails bug has been fixed. (#70)
- fix: Enabling JRuby testing with Rails 4.2 now that the JDBC adapter has been fixed. Fixes #22.
- fix: Fix #11 - Auto eager load associations with joins in Rails 4.2+ now that the underlying Rails bug has been fixed.
- fix: Fix #13 - Handle associations in Rails 4.1 that use unscope.
- fix: Fix #15 - Don't auto eager load associations with finder_sql in Rails 4.0. Previously this was only done for Rails 3.2.
- fix: Fix #16 - Don't auto-eager load has_and_belongs_to_many associations with a uniq since Rails doesn't eager load them properly.
- fix: Fix #17 - Models eager loaded via an explicit call to eager_load now auto eager load nested models.
- fix: Fix #21 - Handle explicit eager loads of singular associations that are nil.
- fix: Fix #23 - Handle polymorphic belongs_to associations in Rails 4 that have a mix of non-nil and nil values.
- fix: Fix #3 - Handle the variants of CollectionAssociation#exists? that take arguments. We don't bother optimizing these variants to be computed off the in-memory models since Rails doesn't and these aren't likely common operations.
- fix: Fix #4 - Auto eager load associations used in after_destroy callbacks.
- fix: Fix #6 - Models loaded through read only associations should be marked as read only.
- fix: Fix #7 - Don't try to auto eager load associations that can't be eager loaded.
- fix: Fix #8 - Don't blow up loading associations when the generated association method has been overridden.
- fix: Fix #88 - Infinite recursion in ActiveStorage::Attachment#blob association (#112)
- fix: Fix CHANGELOG nesting (#114)
- fix: Fix Code Coverage Reporting (#94)
- fix: Fix CollectionProxy#exists? Closes #40
- …and 185 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
salsify/goldiloader 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 64e1a0b9ed4db388668a401297fe2b787a5cdb50 — 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-13a154b7f5d1.