add limit parameter to everything

This commit is contained in:
Toks
2013-05-15 01:01:19 -04:00
parent 6ca588f2e0
commit 9ccf1e0f8f
28 changed files with 28 additions and 28 deletions

View File

@@ -2,7 +2,7 @@ class ArtistVersionsController < ApplicationController
respond_to :html, :xml, :json
def index
@artist_versions = ArtistVersion.search(params[:search]).order("id desc").paginate(params[:page], :search_count => params[:search])
@artist_versions = ArtistVersion.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@artist_versions) do |format|
format.xml do
render :xml => @artist_versions.to_xml(:root => "artist-versions")

View File

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

View File

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

View File

@@ -83,7 +83,7 @@ private
end
def index_by_comment
@comments = Comment.search(params[:search]).order("comments.id DESC").paginate(params[:page], :search_count => params[:search])
@comments = Comment.search(params[:search]).order("comments.id DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@comments) do |format|
format.html {render :action => "index_by_comment"}
format.xml do

View File

@@ -1,5 +1,5 @@
class DelayedJobsController < ApplicationController
def index
@delayed_jobs = Delayed::Job.order("created_at desc").paginate(params[:page])
@delayed_jobs = Delayed::Job.order("created_at desc").paginate(params[:page], :limit => params[:limit])
end
end

View File

@@ -16,7 +16,7 @@ class DmailsController < ApplicationController
def index
cookies[:dmail_folder] = params[:folder]
@search = Dmail.visible.search(params[:search])
@dmails = @search.order("dmails.created_at desc").paginate(params[:page])
@dmails = @search.order("dmails.created_at desc").paginate(params[:page], :limit => params[:limit])
respond_with(@dmails) do |format|
format.xml do
render :xml => @dmails.to_xml(:root => "dmails")

View File

@@ -21,7 +21,7 @@ class ForumPostsController < ApplicationController
else
@search = ForumPost.active.search(params[:search])
end
@forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page], :search_count => params[:search])
@forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@forum_posts) do |format|
format.xml do
render :xml => @forum_posts.to_xml(:root => "forum-posts")

View File

@@ -19,7 +19,7 @@ class ForumTopicsController < ApplicationController
def index
@search = ForumTopic.active.search(params[:search])
@forum_topics = @search.order("is_sticky DESC, updated_at DESC").paginate(params[:page], :search_count => params[:search])
@forum_topics = @search.order("is_sticky DESC, updated_at DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@forum_topics) do |format|
format.xml do
render :xml => @forum_topics.to_xml(:root => "forum-topics")

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
class ModActionsController < ApplicationController
def index
@mod_actions = ModAction.search(params[:search]).order("id desc").paginate(params[:page])
@mod_actions = ModAction.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit])
end
end

View File

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

View File

@@ -3,7 +3,7 @@ class NoteVersionsController < ApplicationController
before_filter :member_only, :except => [:index, :show]
def index
@note_versions = NoteVersion.search(params[:search]).order("note_versions.id desc").paginate(params[:page])
@note_versions = NoteVersion.search(params[:search]).order("note_versions.id desc").paginate(params[:page], :limit => params[:limit])
respond_with(@note_versions) do |format|
format.xml do
render :xml => @note_versions.to_xml(:root => "note-versions")

View File

@@ -6,7 +6,7 @@ class PoolVersionsController < ApplicationController
@pool = Pool.find(params[:search][:pool_id])
end
@pool_versions = PoolVersion.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
@pool_versions = PoolVersion.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@pool_versions) do |format|
format.xml do
render :xml => @pool_versions.to_xml(:root => "pool-versions")

View File

@@ -15,7 +15,7 @@ class PoolsController < ApplicationController
end
def index
@pools = Pool.active.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
@pools = Pool.active.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@pools) do |format|
format.xml do
render :xml => @pools.to_xml(:root => "pools")

View File

@@ -10,7 +10,7 @@ class PostAppealsController < ApplicationController
def index
@search = PostAppeal.order("id desc").search(params[:search])
@post_appeals = @search.paginate(params[:page])
@post_appeals = @search.paginate(params[:page], :limit => params[:limit])
respond_with(@post_appeals) do |format|
format.xml do
render :xml => @post_appeals.to_xml(:root => "post-appeals")

View File

@@ -10,7 +10,7 @@ class PostFlagsController < ApplicationController
def index
@search = PostFlag.order("id desc").search(params[:search])
@post_flags = @search.paginate(params[:page])
@post_flags = @search.paginate(params[:page], :limit => params[:limit])
respond_with(@post_flags) do |format|
format.xml do
render :xml => @post_flags.to_xml(:root => "post-flags")

View File

@@ -3,7 +3,7 @@ class PostVersionsController < ApplicationController
rescue_from ActiveRecord::StatementInvalid, :with => :rescue_exception
def index
@post_versions = PostVersion.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
@post_versions = PostVersion.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@post_versions) do |format|
format.xml do
render :xml => @post_versions.to_xml(:root => "post-versions")

View File

@@ -17,7 +17,7 @@ class TagAliasesController < ApplicationController
def index
@search = TagAlias.search(params[:search])
@tag_aliases = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page])
@tag_aliases = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page], :limit => params[:limit])
respond_with(@tag_aliases) do |format|
format.xml do
render :xml => @tag_aliases.to_xml(:root => "tag-aliases")

View File

@@ -9,7 +9,7 @@ class TagImplicationsController < ApplicationController
def index
@search = TagImplication.search(params[:search])
@tag_implications = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page])
@tag_implications = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page], :limit => params[:limit])
respond_with(@tag_implications) do |format|
format.xml do
render :xml => @tag_implications.to_xml(:root => "tag-implications")

View File

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

View File

@@ -9,7 +9,7 @@ class TagsController < ApplicationController
end
def index
@tags = Tag.search(params[:search]).paginate(params[:page], :search_count => params[:search])
@tags = Tag.search(params[:search]).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@tags) do |format|
format.xml do
render :xml => @tags.to_xml(:root => "tags")

View File

@@ -18,7 +18,7 @@ class UploadsController < ApplicationController
def index
@search = Upload.search(params[:search])
@uploads = @search.order("id desc").paginate(params[:page])
@uploads = @search.order("id desc").paginate(params[:page], :limit => params[:limit])
respond_with(@uploads) do |format|
format.xml do
render :xml => @uploads.to_xml(:root => "uploads")

View File

@@ -21,7 +21,7 @@ class UserFeedbacksController < ApplicationController
def index
@search = UserFeedback.search(params[:search])
@user_feedbacks = @search.paginate(params[:page]).order("created_at desc")
@user_feedbacks = @search.paginate(params[:page], :limit => params[:limit]).order("created_at desc")
respond_with(@user_feedbacks) do |format|
format.xml do
render :xml => @user_feedbacks.to_xml(:root => "user-feedbacks")

View File

@@ -28,7 +28,7 @@ class UserNameChangeRequestsController < ApplicationController
end
def index
@change_requests = UserNameChangeRequest.order("id desc").paginate(params[:page])
@change_requests = UserNameChangeRequest.order("id desc").paginate(params[:page], :limit => params[:limit])
end
def approve

View File

@@ -19,7 +19,7 @@ class UsersController < ApplicationController
@user = User.find_by_name(params[:name])
redirect_to user_path(@user)
else
@users = User.search(params[:search]).order("users.id desc").paginate(params[:page], :search_count => params[:search])
@users = User.search(params[:search]).order("users.id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@users) do |format|
format.xml do
render :xml => @users.to_xml(:root => "users")

View File

@@ -2,7 +2,7 @@ class WikiPageVersionsController < ApplicationController
respond_to :html, :xml, :json
def index
@wiki_page_versions = WikiPageVersion.search(params[:search]).order("id desc").paginate(params[:page], :search_count => params[:search])
@wiki_page_versions = WikiPageVersion.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@wiki_page_versions) do |format|
format.xml do
render :xml => @wiki_page_versions.to_xml(:root => "wiki-page-versions")

View File

@@ -17,7 +17,7 @@ class WikiPagesController < ApplicationController
end
def index
@wiki_pages = WikiPage.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
@wiki_pages = WikiPage.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@wiki_pages) do |format|
format.html do
if @wiki_pages.count == 1 && (params[:page].nil? || params[:page].to_i == 1)