You’ll want to use the order
and limit
methods instead. You can get rid of the all
.
For PostgreSQL and SQLite:
User.order("RANDOM()").limit(10)
Or for MySQL:
User.order("RAND()").limit(10)
You’ll want to use the order
and limit
methods instead. You can get rid of the all
.
For PostgreSQL and SQLite:
User.order("RANDOM()").limit(10)
Or for MySQL:
User.order("RAND()").limit(10)