Rails Engineering Glossary

Purpose

This glossary defines Ruby on Rails terminology used throughout the Engineering Knowledge Framework.

Rails-specific terms defined here are authoritative across the repository. Foundational engineering terms are defined in the Engineering Glossary.

Glossary

ActiveRecord

PropertyValue
DefinitionThe ORM (Object-Relational Mapping) layer in Rails that
maps database tables to Ruby objects and provides
query, persistence and validation capabilities.
ContextActiveRecord is the default model layer in Rails. It
implements the Active Record pattern where a class
wraps a database table.
RelatedMigration, Model
ReferencesRails Engineering Handbook

Concern

PropertyValue
DefinitionA module used to extract shared behaviour from models or
controllers, typically placed in app*models*concerns*
or app*controllers*concerns*.
ContextConcerns are Rails' mechanism for sharing behaviour via
modules. Use them for cross-cutting concerns, but prefer
service objects for complex business logic.
RelatedService Object
ReferencesRails Engineering Handbook

Controller

PropertyValue
DefinitionThe component in MVC that handles incoming HTTP requests,
invokes business logic and renders responses.
ContextControllers should be thin. Business logic belongs in
models, service objects or other domain classes.
RelatedModel, View
ReferencesRails Engineering Handbook

Form Object

PropertyValue
DefinitionA plain Ruby object that encapsulates form validation
and data processing for forms that do not map directly
to a single model.
ContextForm objects are used when a form collects data for
multiple models or has validation logic that does not
belong to any single model.
RelatedService Object
ReferencesRails Engineering Handbook

Migration

PropertyValue
DefinitionA Ruby class that describes a change to the database
schema, allowing incremental, version-controlled schema
evolution.
ContextMigrations are the Rails way to manage database schema
changes. Each migration should change one logical thing
and be reversible.
RelatedActiveRecord
ReferencesRails Engineering Handbook

Model

PropertyValue
DefinitionThe component in MVC that represents business data and
logic. In Rails, models typically inherit from
ActiveRecord::Base.
ContextModels encapsulate domain logic, validations,
associations and queries. Keep them focused on
a single responsibility.
RelatedActiveRecord, Controller, View
ReferencesRails Engineering Handbook

Presenter

PropertyValue
DefinitionAn object that encapsulates presentation logic,
extracting it from views into a testable class.
ContextPresenters wrap model objects with view-specific methods.
They keep views clean and make presentation logic
testable without slow feature specs.
RelatedView, Service Object
ReferencesRails Engineering Handbook

Query Object

PropertyValue
DefinitionA plain Ruby object that encapsulates a complex database
query, extracting it from the model into a separate
class.
ContextQuery objects keep models clean when queries become
complex. They are named after the query they perform.
RelatedActiveRecord, Service Object
ReferencesRails Engineering Handbook

Service Object

PropertyValue
DefinitionA plain Ruby object that encapsulates a single
business operation, typically with one public method.
ContextService objects are the primary pattern for extracting
complex operations from controllers and models. They
are easy to test and can be reused across entry points.
RelatedForm Object, Query Object, Concern
ReferencesRails Engineering Handbook

View

PropertyValue
DefinitionThe component in MVC responsible for rendering the user
interface, typically using ERB or other template
languages.
ContextViews should contain minimal logic. Presentation logic
belongs in presenters, decorators or helpers.
RelatedController, Model
ReferencesRails Engineering Handbook

Related Documents