fixes to user search
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user