Composite Primary KeysThis guide is an introduction to composite primary keys for database tables.After reading this guide you will be able to: Create a table with a composite primary key Query a model with a composite primary key Enable your model to use a composite primary key for queries and associations Create forms for models that use composite primary keys Extract composite primary keys from controller parameters Use database fixtures for tables with composite primary keys| Ruby on Rails Guides
Brandur digs into one of Postgres 17's updates that make b-tree index scans faster. He's tested performance against the Crunchy Bridge API and the results are pretty impressive.| Crunchy Data
Active Record CallbacksThis guide teaches you how to hook into the life cycle of your Active Record objects.After reading this guide, you will know: When certain events occur during the life of an Active Record object. How to register, run, and skip callbacks that respond to these events. How to create relational, association, conditional, and transactional callbacks. How to create objects that encapsulate common behavior for your callbacks to be reused.| Ruby on Rails Guides
Using a two-phase data load and render pattern to prevent N+1 queries in a generalized way. Especially useful in Go, but applicable in any language.| brandur.org
Active Record Relation.| api.rubyonrails.org
Active Record AssociationsThis guide covers the association features of Active Record.After reading this guide, you will know how to: Understand the various types of associations. Declare associations between Active Record models. Choose the right association type for your models. Use Single Table Inheritance. Setting up and using Delegated Types.| Ruby on Rails Guides
Active Record restates the traditional question of how to separate persistence from domain logic: what if you don’t have to?| 37signals Dev
Active Record Query InterfaceThis guide covers different ways to retrieve data from the database using Active Record.After reading this guide, you will know: How to find records using a variety of methods and conditions. How to specify the order, retrieved attributes, grouping, and other properties of the found records. How to use eager loading to reduce the number of database queries needed for data retrieval. How to use dynamic finder methods. How to use method chaining to use multiple Acti...| Ruby on Rails Guides
Active Record lets you access raw SQL. We look at 5 business requests for data, translate them into SQL, then into Rails code to find the requested data.| pganalyze
Active Record BasicsThis guide is an introduction to Active Record.After reading this guide, you will know: How Active Record fits into the Model-View-Controller (MVC) paradigm. What Object Relational Mapping and Active Record patterns are and how they are used in Rails. How to use Active Record models to manipulate data stored in a relational database. Active Record schema naming conventions. The concepts of database migrations, validations, callbacks, and associations.| Ruby on Rails Guides
Some things you should know about eager loading in ActiveRecord| Florin Lipan