Commit 3a31499
Use
`#count` will always execute an SQL COUNT query whereas `#size` will
check if the records are already loaded (and then call `#length`). It
only executes a count when necessary.
See https://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-size#size instead of #count for pagination1 parent 9dee9d8 commit 3a31499
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments