Skip to content

Instantly share code, notes, and snippets.

@Fitzsimmons
Created October 31, 2012 19:19
Show Gist options
  • Save Fitzsimmons/3989225 to your computer and use it in GitHub Desktop.
Save Fitzsimmons/3989225 to your computer and use it in GitHub Desktop.
Modify an existing arel query to use the window function for the non_paged_count
results = arel.
select("COUNT(#{table_name}.id) OVER () AS non_paged_count, #{table_name}.*").
offset(offset).
limit(per_page).all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment