Skip to content

Commit

Permalink
[ci skip] Add skip_preload to README
Browse files Browse the repository at this point in the history
  • Loading branch information
OuYangJinTing committed Jul 20, 2020
1 parent 7a5f73e commit fb27176
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -44,6 +44,11 @@ ArLazyPreload.config.auto_preload = true

After that there is no need to call `#lazy_preload` on the association, everything would be loaded lazily.

If you don't want to load all records's associations, you can use `skip_preload` before associations method, it only load single record's associations:

```ruby
users.first.skip_preload.posts # => SELECT * FROM posts WHERE user_id = ?

## Installation

Add this line to your application's Gemfile, and you're all set:
Expand Down

0 comments on commit fb27176

Please sign in to comment.