Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
jimmaswell
· 10y ago · 0 comments
In this example, it seems like it could be an issue that you take everything and then only use the first 10, instead of only taking the first 10 to begin with. Is there a way to not make it take them all, like putting the limit parameter in where()?
Comments
[–]
kaolinite
10y ago
Rails doesn't execute the query until you actually use it in some way, by which point it knows you've added a limit clause.