Skip to content
This repository
Browse code

Use `find_each` instead of `all`, since there might be a lot of users…

… and you do not want to load them all into memory. `find_each` loads them in batches of 1000.
  • Loading branch information...
commit 1be839f7802bb2364cdcb62916ab70b30ad9c718 1 parent 43f4611
Manuel Meurer manuelmeurer authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  README.md
2  README.md
Source Rendered
@@ -67,7 +67,7 @@ The current docs can always be found
67 67 # If you're adding FriendlyId to an existing app and need
68 68 # to generate slugs for existing users, do this from the
69 69 # console, runner, or add a Rake task:
70   - User.all.map(&:save)
  70 + User.find_each(&:save)
71 71
72 72
73 73 ## Benchmarks

0 comments on commit 1be839f

Please sign in to comment.
Something went wrong with that request. Please try again.