How can I get FOUND_ROW()s from an active record object in rails?
- by Justin Tanner
When querying the database with:
@robots = Robot.all(:limit => 50, :offset => 0)
What is the best way to get the total number of rows without the :limit?
In raw MySQL you could do something like this:
SELECT SQL_CALC_FOUND_ROWS * FROM robots LIMIT 0, 50
SELECT FOUND_ROWS();