ActiveRecord, eager loading, and SQL LIMIT/OFFSET
The eager loading of associations that where first introduced in Rails 0.12.0 suffer from one drawback: It’s not possible to specify :limit or :offset on ActiveRecord’s find method. Here’s a way to work around this, by using an SQL subquery to select the correct ids: page = 1 per_page = 25 limit = “LIMIT #{per_page} … Continue reading ActiveRecord, eager loading, and SQL LIMIT/OFFSET
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed