Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"empty?" docs: Suggest "load.empty?" over "length.zero?" [ci skip]
If "collection.empty?" is what you wanted to do, but you need to work around a collection-loading gotcha, "collection.load.empty?" is much closer to the intended code than changing the method entirely to do "collection.length.zero?" instead. Read more: https://thepugautomatic.com/2021/02/using-load-with-any-to-avoid-double-queries-from-activerecord/
- Loading branch information