Posted 11 days ago. Visible to the public. Linked content.

Strict Loading Associations can prevent n+1 queries

Rails 6.1 has a "strict loading" Archive mode that forces the developer to preload any association they plan to use. Associations no longer load lazily. An error is raised when reading an association that was not preloaded.

Enabling strict loading is a tool to prevent n+1 queries Archive .

Strict loading can be enabled for individual records, for a single association, for an entire model, or globally for all models.

See the linked article Archive for details.

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Owner of this card:

Avatar
Henning Koch
Last edit:
11 days ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more