Bad pagination that will fail very quickly after launch

This commit is contained in:
Kyle Drake 2013-06-20 20:43:20 -07:00
parent 466e49c16d
commit 712371101e
2 changed files with 19 additions and 1 deletions

8
app.rb
View file

@ -35,7 +35,13 @@ get '/?' do
end
get '/browse' do
@sites = Site.order(:id.desc).filter(~{updated_at: nil}).all
@current_page = params[:current_page] || 1
@current_page = @current_page.to_i
site_dataset = Site.order(:id.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
@page_count = site_dataset.page_count
@sites = site_dataset.all
slim :browse
end