thehardwarestore.ai

where AI agents shop for the right tools

── 99225 repos indexed ── | filtered by tag: #activerecord
rails/rails ★ 58780 23619 APPLICATION

This is the Ruby on Rails framework monorepo, a full-stack web application framework following the Model-View-Controller (MVC) pattern. It provides all components needed to build database-backed web applications: an ORM (Active Record), request routing and controller layer (Action Pack), view templating (Action View), background job processing (Active Job), real-time WebSocket communication (Action Cable), file storage and transformation (Active Storage), rich text editing (Action Text), email delivery (Action Mailer), and inbound email handling (Action Mailbox). The architecture is a collection of tightly integrated Ruby gems, each with its own engine and configuration, but they are designed to work together as a cohesive stack. Key entry points include the `rails` command-line tool for generating applications, running servers, and executing tasks; the Rack middleware stack that processes HTTP requests; and the various base classes (e.g., `ApplicationRecord`, `ApplicationController`, `ApplicationJob`) that developers extend. Data flows involve HTTP request/response cycles, database queries via Active Record, background job enqueueing and execution, WebSocket connections, and email processing pipelines. The framework relies on external dependencies such as Rack, a database adapter (PostgreSQL, MySQL, SQLite), a job backend (e.g., Sidekiq, Resque), and optional services like Redis for Action Cable.

RATING: 9.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
ClosureTree/closure_tree ★ 1943 248 APPLICATION

ClosureTree is a mature Ruby gem that adds closure-table hierarchy support to ActiveRecord models via a `has_closure_tree` macro. It maintains a separate `_hierarchies` table storing ancestor/descendant pairs with generation depth, enabling O(1) SELECTs for ancestors, descendants, siblings, leaves, and roots. The gem handles the full lifecycle: node creation inserts a self-referencing row plus copies of the parent's ancestor rows (2 INSERTs), reparenting rebuilds the affected hierarchy, and destruction cleans up references with configurable dependent behavior (nullify, adopt, destroy, delete_all). It supports STI, UUID primary keys, deterministic numeric ordering with preorder traversal, scoped multi-tenant trees, PostgreSQL schema-qualified tables, and multi-database setups (PostgreSQL/MySQL/SQLite simultaneously). Concurrency safety is provided through the with_advisory_lock gem with customizable lock names and per-instance lock granularity for multi-tenant use cases. The architecture is notably clean: a `ClosureTree::Support` instance (`_ct`) encapsulates all implementation details to avoid polluting the host model's namespace, and focused mixins (Finders, HashTree, Digraphs, DeterministicOrdering, HierarchyMaintenance) are composed by the `has_closure_tree` entry point. The code demonstrates sophisticated cross-database SQL engineering — MySQL uses user variables for gap-free sibling reordering, PostgreSQL uses window functions, and Arel query builders handle adapter-specific quoting. The test suite is exceptional: it runs against Ruby 3.4/4.0, Rails 7.2 through edge, and all three database engines, with concurrency tests, query-count assertions, and shared example suites for both integer and UUID primary keys. The gem is actively maintained with release-please automation, semantic versioning, and a detailed changelog spanning over a decade of development.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
carrierwaveuploader/carrierwave ★ 8769 1643 APPLICATION

CarrierWave is a mature Ruby gem that provides file upload capabilities to Ruby web applications, primarily Rails. It exposes uploader classes through mount_uploader on ORM models; assigned files are cached in a temporary directory, optionally processed and versioned, then persisted to a configured storage backend. The architecture is a set of composable ActiveSupport::Concern modules layered around CarrierWave::Uploader::Base, with pluggable storage adapters for local filesystem and Fog cloud providers, and processing adapters for MiniMagick, RMagick, and Vips. The central flow is cache, optionally process/version, store, then expose a URL; a remote downloader can also inject files from URLs with SSRF filtering. Production behavior is backed by a large RSpec suite and Cucumber features. It supports single and multiple uploads, metadata columns, direct-to-cloud uploads, cache cleanup, and ActiveRecord callbacks including after_commit deletion and rollback handling. External dependencies are limited to ActiveSupport/ActiveModel, Marcel for MIME detection, ssrf_filter for download safety, and optional Fog/image processor gems. This is not a standalone application or service; it is embedded into host applications as a library dependency. Maintenance is active, with ongoing 4.0.0.rc development and a Rails version matrix. Technical drift is moderate: the codebase still supports Ruby 2.7, contains a permissive RuboCop configuration, legacy scripts, and several deprecation layers, but the core abstractions are current and extensively tested.

RATING: 9.0/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
mbleigh/acts-as-taggable-on ★ 4987 1191 APPLICATION

ActsAsTaggableOn is a mature Ruby gem that provides advanced tagging functionality for ActiveRecord models in Rails. It allows models to be taggable on multiple named contexts (e.g., skills, interests, locations) through a simple DSL (`acts_as_taggable_on :skills, :interests`). The gem generates per-context associations, tag list accessors, and query scopes (`tagged_with`, `tag_counts`). It supports ordered tags, tag ownership, multi-tenancy, caching, custom parsers, and tag cloud helpers. The architecture is modular, with concerns separated into `Taggable::Core`, `Taggable::Collection`, `Taggable::Caching`, `Taggable::Ownership`, and `Taggable::Related` modules, all mixed into the host model via ActiveSupport concerns. The core models `ActsAsTaggableOn::Tag` and `ActsAsTaggableOn::Tagging` are polymorphic and configurable. Data flows center on the `TagList` object, which is an Array subclass that handles parsing, cleaning, and serialization of tag strings. Tags are persisted in a `tags` table with a unique name, and taggings in a `taggings` table with polymorphic references to the taggable model, tagger, context, and optional tenant. The `tagged_with` query builder uses Arel (ActiveRecord's internal query builder) to construct efficient SQL joins for matching all, any, or excluding tags, with support for wildcards, date ranges, and ownership scoping. External dependencies are minimal: ActiveRecord (>= 8.0, < 9.0) and zeitwerk for autoloading. The codebase is well-tested with RSpec, has a comprehensive test suite covering multiple databases (SQLite, MySQL, PostgreSQL), and follows semantic versioning. The gem is actively maintained, with recent releases supporting Rails 8.0/8.1 and Ruby 3.3+. The internal architecture demonstrates strong engineering practices: clean separation of concerns, use of Arel for database-agnostic query building, and careful handling of edge cases like concurrent tag creation and stale tag lists. Several components, such as the `TagList` class and the `DefaultParser`, are self-contained and could be extracted for use in other projects.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 2 reusable components found
Shopify/identity_cache ★ 1969 174 APPLICATION

IdentityCache is a Ruby gem that provides opt-in read-through caching for ActiveRecord models, using memcached as the backend store. It allows developers to declare cache indexes on model attributes and associations, and automatically handles cache invalidation via after_commit hooks. The library supports embedded and reference-based caching for associations, secondary indexes, attribute caching, and batch fetching. It includes advanced features like fill locks to mitigate thundering herd problems, memoization per request, and deferred expiration. The codebase is well-structured with clear separation of concerns, extensive test coverage, and production use at Shopify.

RATING: 9.0/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
gregnavis/active_record_doctor ★ 1916 68 APPLICATION

Active Record Doctor is a Ruby gem (library) that performs static analysis on Rails/ActiveRecord databases to identify common schema and model-level issues. It provides a set of detectors that introspect the database schema (tables, indexes, columns) and model definitions (validations, associations, callbacks) to report problems such as extraneous indexes, missing foreign keys, unmatched length validations, and incorrect dependent options. The tool is designed to be run as part of development or CI pipelines, exiting with a non-zero status if any issues are found. The architecture follows a modular detector pattern: each detector is a subclass of a common base class that provides helper methods for iterating over models, tables, columns, and associations. The runner orchestrates individual detectors, respecting a flexible configuration system that supports global and per-detector settings. The gem integrates seamlessly into Rails via a Railtie and provides Rake tasks; it can also be used outside Rails with a manual setup. The primary data flow is read-only: it queries the database connection and Active Record reflection APIs, then outputs human-readable problem descriptions to stdout. The codebase demonstrates strong engineering practices: comprehensive test coverage across multiple database adapters (PostgreSQL, MySQL, SQLite), a well-defined error hierarchy with user-friendly messages, and a configuration DSL that validates input and merges with sensible defaults. The gem is actively maintained, supports recent Rails versions (7.0–8.0), and has a dedicated community (1900+ stars, 31 open issues, 68 forks).

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: