fixes to user search

This commit is contained in:
albert
2013-02-21 12:42:41 -05:00
parent 762bbd2caf
commit 78f1d0f69a
24 changed files with 48 additions and 30 deletions

View File

@@ -13,7 +13,7 @@ class AdvertisementsController < ApplicationController
end
def index
@advertisements = Advertisement.all
@advertisements = Advertisement.order("id desc").all
@start_date = 1.month.ago.to_date
@end_date = Date.today
end

View File

@@ -2,7 +2,7 @@ class ArtistVersionsController < ApplicationController
respond_to :html, :xml, :json
def index
@artist_versions = ArtistVersion.search(params[:search]).paginate(params[:page])
@artist_versions = ArtistVersion.search(params[:search]).order("id desc").paginate(params[:page])
respond_with(@artist_versions)
end
end

View File

@@ -18,7 +18,7 @@ class ArtistsController < ApplicationController
end
def index
@artists = Artist.search(params[:search]).paginate(params[:page])
@artists = Artist.search(params[:search]).order("id desc").paginate(params[:page])
respond_with(@artists) do |format|
format.xml do
render :xml => @artists.to_xml(:include => [:urls])

View File

@@ -10,7 +10,7 @@ class BansController < ApplicationController
end
def index
@search = Ban.search(params[:search])
@search = Ban.search(params[:search]).order("id desc")
@bans = @search.paginate(params[:page])
end

View File

@@ -15,7 +15,7 @@ class DmailsController < ApplicationController
def index
@search = Dmail.visible.search(params[:search])
@dmails = @search.paginate(params[:page]).order("dmails.created_at desc")
@dmails = @search.order("dmails.created_at desc").paginate(params[:page])
respond_with(@dmails)
end

View File

@@ -17,7 +17,7 @@ class ForumPostsController < ApplicationController
def index
@search = ForumPost.active.search(params[:search])
@forum_posts = @search.paginate(params[:page]).order("forum_posts.id DESC")
@forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page])
respond_with(@forum_posts)
end

View File

@@ -19,7 +19,7 @@ class ForumTopicsController < ApplicationController
def index
@search = ForumTopic.active.search(params[:search])
@forum_topics = @search.paginate(params[:page]).order("is_sticky DESC, updated_at DESC")
@forum_topics = @search.order("is_sticky DESC, updated_at DESC").paginate(params[:page])
respond_with(@forum_topics)
end

View File

@@ -12,7 +12,7 @@ class IpBansController < ApplicationController
def index
@search = IpBan.search(params[:search])
@ip_bans = @search.paginate(params[:page])
@ip_bans = @search.order("id desc").paginate(params[:page])
end
def destroy

View File

@@ -14,7 +14,7 @@ class JanitorTrialsController < ApplicationController
def index
@search = JanitorTrial.search(params[:search])
@janitor_trials = @search.paginate(params[:page])
@janitor_trials = @search.order("id desc").paginate(params[:page])
respond_with(@janitor_trials)
end

View File

@@ -3,7 +3,7 @@ class NewsUpdatesController < ApplicationController
respond_to :html
def index
@news_updates = NewsUpdate.paginate(params[:page])
@news_updates = NewsUpdate.order("id desc").paginate(params[:page])
respond_with(@news_updates)
end

View File

@@ -64,7 +64,7 @@ private
def index_by_note
@search = Note.search(params[:search])
@notes = @search.paginate(params[:page])
@notes = @search.order("id desc").paginate(params[:page])
respond_with(@notes) do |format|
format.html {render :action => "index_by_note"}
end

View File

@@ -16,7 +16,7 @@ class PoolsController < ApplicationController
def index
@search = Pool.active.search(params[:search])
@pools = @search.paginate(params[:page]).order("updated_at desc")
@pools = @search.order("updated_at desc").paginate(params[:page])
respond_with(@pools)
end

View File

@@ -9,7 +9,7 @@ class PostAppealsController < ApplicationController
end
def index
@search = PostAppeal.search(params[:search]).order("id desc")
@search = PostAppeal.order("id desc").search(params[:search])
@post_appeals = @search.paginate(params[:page])
end

View File

@@ -9,7 +9,7 @@ class PostFlagsController < ApplicationController
end
def index
@search = PostFlag.search(params[:search]).order("id desc")
@search = PostFlag.order("id desc").search(params[:search])
@post_flags = @search.paginate(params[:page])
end

View File

@@ -16,7 +16,7 @@ class TagSubscriptionsController < ApplicationController
def index
@user = CurrentUser.user
@search = TagSubscription.owned_by(@user).search(params[:search])
@search = TagSubscription.owned_by(@user).order("name").search(params[:search])
@tag_subscriptions = @search.paginate(params[:page])
respond_with(@tag_subscriptions)
end

View File

@@ -16,7 +16,7 @@ class UsersController < ApplicationController
def index
@search = User.search(params[:search])
@users = @search.paginate(params[:page]).order("users.name")
@users = @search.order("users.id desc").paginate(params[:page])
respond_with(@users)
end

View File

@@ -3,7 +3,7 @@ class WikiPageVersionsController < ApplicationController
def index
@search = WikiPageVersion.search(params[:search])
@wiki_page_versions = @search.paginate(params[:page])
@wiki_page_versions = @search.order("id desc").paginate(params[:page])
respond_with(@wiki_page_versions)
end

View File

@@ -16,7 +16,7 @@ class WikiPagesController < ApplicationController
def index
@search = WikiPage.search(params[:search])
@wiki_pages = @search.paginate(params[:page])
@wiki_pages = @search.order("id desc").paginate(params[:page])
respond_with(@wiki_pages) do |format|
format.html do
if @wiki_pages.count == 1