From 9120449abf8ac70148b3b74d2c80e19ed99b5afc Mon Sep 17 00:00:00 2001 From: OuYangJinTing Date: Tue, 14 Oct 2025 18:05:11 +0800 Subject: [PATCH] Add N plus one operation solution section to README --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 3251a97..58b3471 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ - [Using Entities](#using-entities) - [Entity Organization](#entity-organization) - [Caveats](#caveats) + - [Preloading Associations](#preloading-associations) - [Installation](#installation) - [Testing with Entities](#testing-with-entities) - [Project Resources](#project-resources) @@ -674,6 +675,10 @@ end Also note that an `ArgumentError` is raised when unknown options are passed to either `expose` or `with_options`. +### Preloading Associations + +Use [Grape::Entity::Preloader](https://github.com/OuYangJinTing/grape-entity-preloader) to preload associations and callbacks and avoid N+1 operations. + ## Installation Add this line to your application's Gemfile: