Open-Source Wikis

/

Ruby on Rails

/

Ruby on Rails

/

Glossary

rails/rails

Glossary

Vocabulary used throughout the Rails codebase. This is not the public Rails API; it's the words you'll bump into while reading the source.

Architectural terms

  • Component / framework — one of the 12 gems in the monorepo (Active Record, Action Pack, etc.). The terms are used interchangeably.
  • Railtie — a small subclass of Rails::Railtie that hooks a gem into the Rails boot process. Every framework defines one. See railties/lib/rails/railtie.rb.
  • Engine — a full mini-application that ships its own app/, config/, and lib/. Rails::Engine < Rails::Railtie, and Rails::Application < Rails::Engine. See railties/lib/rails/engine.rb.
  • Application — the user's app, an instance of Rails::Application (their config/application.rb defines MyApp::Application).
  • Initializer — a block of code declared via initializer "name" on a Railtie/Engine; runs in dependency order during boot. The phases are documented in railties/lib/rails/application.rb.
  • Lazy load hooksActiveSupport.on_load(:active_record) { ... } lets a gem patch a class only after that class is defined, preserving load-time independence. See activesupport/lib/active_support/lazy_load_hooks.rb.
  • Autoloader / Zeitwerk — Rails uses Zeitwerk for autoloading code. Wrappers live in activesupport/lib/active_support/dependencies/autoload.rb and railties/lib/rails/autoloaders.rb.
  • ConcernActiveSupport::Concern (activesupport/lib/active_support/concern.rb) is the standard mixin pattern for modules that need their own class methods and dependencies.
  • NotificationsActiveSupport::Notifications is the pub/sub bus. Components publish events like sql.active_record and process_action.action_controller; subscribers (log subscribers, instrumenters, tests) consume them.

HTTP and routing

  • Rack — the Ruby web-server interface. Every Rails request begins as a Rack env hash and ends as a [status, headers, body] triple.
  • Middleware — Rack middleware ordered in actionpack/lib/action_dispatch/middleware/stack.rb. The default stack is built in railties/lib/rails/application/default_middleware_stack.rb.
  • Router / route setActionDispatch::Routing::RouteSet (actionpack/lib/action_dispatch/routing/route_set.rb) maps URLs to controller#action.
  • Journey — the routing engine itself, a port of an in-house pattern matcher. Lives in actionpack/lib/action_dispatch/journey/.
  • Endpoint — what RouteSet#dispatch calls; usually a controller class but can be any Rack app.
  • MetalActionController::Metal (actionpack/lib/action_controller/metal.rb) is the minimal controller base class that includes only what you opt into. ActionController::Base and ::API build on it.

Active Record terms

  • Connection adapter — a subclass of ActiveRecord::ConnectionAdapters::AbstractAdapter. Translates Ruby calls into SQL for a specific database. The shipped ones are mysql2, trilogy, postgresql, sqlite3.
  • Connection pool / handler — manages connections per thread. See activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb.
  • Schema cache — cached column definitions to avoid round-trips at boot. See activerecord/lib/active_record/connection_adapters/schema_cache.rb.
  • Relation — an ActiveRecord::Relation. A composable, lazy query builder. See activerecord/lib/active_record/relation.rb.
  • Predicate builder — turns hashes like { name: "Bob" } into Arel WHERE nodes. See activerecord/lib/active_record/relation/predicate_builder.rb.
  • Arel — the SQL AST library used internally by Active Record. Lives in activerecord/lib/arel/.
  • TypeActiveRecord::Type and ActiveModel::Type define how columns map to Ruby objects (String, Integer, Time, JSON, etc.).
  • Association — has_many / belongs_to / has_one / has_many :through, etc. Implementation lives in activerecord/lib/active_record/associations/.
  • Migration — Ruby DSL for schema changes (activerecord/lib/active_record/migration.rb).
  • Multiple databases — Rails supports primary/replica routing via ActiveRecord::Base.connects_to and ApplicationRecord.connected_to. Handled in activerecord/lib/active_record/database_configurations/ and connection_handling.rb.

Active Job terms

  • Queue adapter — pluggable backend (Sidekiq, Resque, GoodJob, Solid Queue, etc.). Built-in adapters live in activejob/lib/active_job/queue_adapters/.
  • Argument serializationActiveJob::Arguments serializes job arguments to a JSON-safe form so adapters can persist them.
  • Continuation / continuable — a recently-added pattern (activejob/lib/active_job/continuation/) for resuming long-running jobs after restarts.

Active Storage terms

  • Service — a storage backend. Built-in services in activestorage/lib/active_storage/service/: DiskService, S3Service, GCSService, MirrorService. Azure was extracted to a separate gem.
  • Blob — the ActiveStorage::Blob model represents one stored file plus its metadata.
  • Attachment — a join record (ActiveStorage::Attachment) tying a Blob to a parent record.
  • Variant — a derivation of a Blob (resized image, transcoded video). See activestorage/lib/active_storage/transformers/.
  • Previewer / Analyzer — extracts metadata or generates a preview image (activestorage/lib/active_storage/previewer/, analyzer/).

Action Cable terms

  • Channel — the unit of subscription on the server (actioncable/lib/action_cable/channel/). Like a controller, but for WebSocket subscriptions.
  • Connection — one client's persistent socket; authentication and identification happens here (actioncable/lib/action_cable/connection/).
  • Subscription adapter — pluggable broadcast backend (async, redis, postgresql, solid_cable).

Action Mailer / Mailbox / Text

  • Mailer — a class inheriting from ActionMailer::Base. Each public instance method is a deliverable email.
  • Inbound email — a saved email message accepted by Action Mailbox.
  • Routing — the DSL in application_mailbox.rb matches inbound emails to mailboxes.
  • Trix — the in-browser rich-text editor used by Action Text.
  • Action Text contentActionText::Content wraps the HTML fragment plus its embedded attachments (actiontext/lib/action_text/content.rb).

Active Support terms

  • Core extensions — patches to standard library classes (Object, String, Hash, etc.) under activesupport/lib/active_support/core_ext/. Each file can be required individually.
  • Cache store — a subclass of ActiveSupport::Cache::Store (memory, file, mem_cache, redis, null, plus Solid Cache as a separate gem).
  • Current attributesActiveSupport::CurrentAttributes is per-request global state that's safe across threads.
  • Error reporterActiveSupport::ErrorReporter is the canonical way to capture exceptions for monitoring backends.
  • Event reporter — newer subsystem in activesupport/lib/active_support/event_reporter/ for emitting structured events.
  • Executor / reloaderActiveSupport::Executor and ActiveSupport::Reloader wrap units of work so the framework can reload code in development.

Conventions and patterns

  • Convention over configuration — Rails' design ethos. A controller called PostsController automatically renders templates from app/views/posts/, queries the posts table, etc.
  • load_defaultsRails::Application::Configuration#load_defaults(version) opts an app into the recommended config for a given Rails version (railties/lib/rails/application/configuration.rb).
  • config.action_*, config.active_* — every component reads its own config namespace from the application config.
  • Top-level deprecator — each component owns a Deprecator instance so warnings can be silenced or escalated per gem (activerecord/lib/active_record/deprecator.rb and friends).
  • Frozen string literals — every Ruby file in the repo starts with # frozen_string_literal: true.
  • Minitest, not RSpec — Rails uses Minitest. Test files live in test/, never spec/.
  • bin/test — the per-component test runner. Wraps tools/test.rb.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Glossary – Ruby on Rails wiki | Factory