Read more

Strict Loading Associations can prevent n+1 queries

Henning Koch
October 13, 2021Software engineer at makandra GmbH

Rails 6.1 has a "strict loading" Show archive.org snapshot 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.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Enabling strict loading is a tool to prevent n+1 queries Show archive.org snapshot .

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 Show archive.org snapshot for details.

Posted by Henning Koch to makandra dev (2021-10-13 12:33)