Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.

Commit

Permalink
more useful ordering in the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Wyszynski committed Apr 27, 2012
1 parent 35894a9 commit efd62c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cabalist/frontend.rb
Expand Up @@ -65,7 +65,7 @@ def piechart_by_scope(klass)
get "/:class_name/all/?:page?" do
page = params[:page].to_i < 1 ? 1 : params[:page].to_i
klass = params[:class_name].titleize.constantize
@collection = klass::page(page).per(PER_PAGE)
@collection = klass::order("id DESC").page(page).per(PER_PAGE)
haml :classifier,
:locals => { :klass => klass,
:page => page,
Expand All @@ -77,7 +77,7 @@ def piechart_by_scope(klass)
get "/:class_name/none/?:page?" do
klass = params[:class_name].titleize.constantize
page = params[:page].to_i < 1 ? 1 : params[:page].to_i
@collection = klass::not_classified \
@collection = klass::not_classified.order("id DESC") \
.page(page).per(PER_PAGE)
haml :classifier,
:locals => { :klass => klass,
Expand All @@ -90,7 +90,7 @@ def piechart_by_scope(klass)
get "/:class_name/manual/?:page?" do
klass = params[:class_name].titleize.constantize
page = params[:page].to_i < 1 ? 1 : params[:page].to_i
@collection = klass::manually_classified \
@collection = klass::manually_classified.order("id DESC") \
.page(page).per(PER_PAGE)
haml :classifier,
:locals => { :klass => klass,
Expand All @@ -103,7 +103,7 @@ def piechart_by_scope(klass)
get "/:class_name/auto/?:page?" do
klass = params[:class_name].titleize.constantize
page = params[:page].to_i < 1 ? 1 : params[:page].to_i
@collection = klass::auto_classified. \
@collection = klass::auto_classified.order("autoclassified_at DESC"). \
page(page).per(PER_PAGE)
haml :classifier,
:locals => { :klass => klass,
Expand Down

0 comments on commit efd62c3

Please sign in to comment.