]> source.dussan.org Git - redmine.git/commitdiff
Deprecation warnings (#12774).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 8 Jan 2013 20:18:12 +0000 (20:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 8 Jan 2013 20:18:12 +0000 (20:18 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11139 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/boards_controller.rb
app/controllers/issues_controller.rb
app/controllers/members_controller.rb
app/controllers/messages_controller.rb
app/controllers/news_controller.rb
app/controllers/queries_controller.rb
app/controllers/repositories_controller.rb
app/controllers/timelog_controller.rb
app/controllers/users_controller.rb
app/controllers/wiki_controller.rb
lib/redmine/pagination.rb

index 790e3ef75dd1f1982beef90fa8f091a6d37493cd..3868c0b1fc65148ec2fbf92256311b77cd27d993 100644 (file)
@@ -42,12 +42,12 @@ class BoardsController < ApplicationController
                     'updated_on' => "#{Message.table_name}.updated_on"
 
         @topic_count = @board.topics.count
-        @topic_pages = Paginator.new self, @topic_count, per_page_option, params['page']
+        @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
         @topics =  @board.topics.
           reorder("#{Message.table_name}.sticky DESC").
           includes(:author, {:last_reply => :author}).
           limit(@topic_pages.items_per_page).
-          offset(@topic_pages.current.offset).
+          offset(@topic_pages.offset).
           order(sort_clause).
           all
         @message = Message.new(:board => @board)
index 4869d1e2b412fd678490eda68af38bbc6e7182fa..e86589fbfa5bd876ff23f3e40293e01d06f496aa 100644 (file)
@@ -71,8 +71,8 @@ class IssuesController < ApplicationController
       end
 
       @issue_count = @query.issue_count
-      @issue_pages = Paginator.new self, @issue_count, @limit, params['page']
-      @offset ||= @issue_pages.current.offset
+      @issue_pages = Paginator.new @issue_count, @limit, params['page']
+      @offset ||= @issue_pages.offset
       @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
                               :order => sort_clause,
                               :offset => @offset,
index c1f737dc94764fd37b82485971f8a16d577cc365..68b5c7421b9adb42c18c3f2ea188eead7d77a137 100644 (file)
@@ -26,8 +26,8 @@ class MembersController < ApplicationController
   def index
     @offset, @limit = api_offset_and_limit
     @member_count = @project.member_principals.count
-    @member_pages = Paginator.new self, @member_count, @limit, params['page']
-    @offset ||= @member_pages.current.offset
+    @member_pages = Paginator.new @member_count, @limit, params['page']
+    @offset ||= @member_pages.offset
     @members =  @project.member_principals.all(
       :order => "#{Member.table_name}.id",
       :limit  =>  @limit,
index 82b74dda58179d7a057e7d98a632dd8598286740..46278aa6c356f43fdeef350a0b7113e6bd8f7e2a 100644 (file)
@@ -40,12 +40,12 @@ class MessagesController < ApplicationController
     end
 
     @reply_count = @topic.children.count
-    @reply_pages = Paginator.new self, @reply_count, REPLIES_PER_PAGE, page
+    @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
     @replies =  @topic.children.
       includes(:author, :attachments, {:board => :project}).
       reorder("#{Message.table_name}.created_on ASC").
       limit(@reply_pages.items_per_page).
-      offset(@reply_pages.current.offset).
+      offset(@reply_pages.offset).
       all
 
     @reply = Message.new(:subject => "RE: #{@message.subject}")
index 160328ebc255d9a2bdcf30eb80ceeed592118c08..c32a5279e7091b7ef0411dae3fc63a9195c45683 100644 (file)
@@ -40,8 +40,8 @@ class NewsController < ApplicationController
     scope = @project ? @project.news.visible : News.visible
 
     @news_count = scope.count
-    @news_pages = Paginator.new self, @news_count, @limit, params['page']
-    @offset ||= @news_pages.current.offset
+    @news_pages = Paginator.new @news_count, @limit, params['page']
+    @offset ||= @news_pages.offset
     @newss = scope.all(:include => [:author, :project],
                                        :order => "#{News.table_name}.created_on DESC",
                                        :offset => @offset,
index 2993b8e86693213f029952132d8bb0868026c7a4..728a6612bf35beb22a7e2c1c2944fe94f54e179a 100644 (file)
@@ -33,7 +33,7 @@ class QueriesController < ApplicationController
     end
 
     @query_count = IssueQuery.visible.count
-    @query_pages = Paginator.new self, @query_count, @limit, params['page']
+    @query_pages = Paginator.new @query_count, @limit, params['page']
     @queries = IssueQuery.visible.all(:limit => @limit, :offset => @offset, :order => "#{Query.table_name}.name")
 
     respond_to do |format|
index 5f5eb5e6ffff2f70e192ba548cb75577ab7ca40c..d0e5b4918e5c545efcba6a572dce190027586fc3 100644 (file)
@@ -138,12 +138,12 @@ class RepositoriesController < ApplicationController
 
   def revisions
     @changeset_count = @repository.changesets.count
-    @changeset_pages = Paginator.new self, @changeset_count,
+    @changeset_pages = Paginator.new @changeset_count,
                                      per_page_option,
                                      params['page']
     @changesets = @repository.changesets.
       limit(@changeset_pages.items_per_page).
-      offset(@changeset_pages.current.offset).
+      offset(@changeset_pages.offset).
       includes(:user, :repository, :parents).
       all
 
index 7c6e31de07dfff9e279a1cac83bb08c95999c1ba..c007a6da2555b50cb5f2567d8c1acab90a67cf45 100644 (file)
@@ -51,12 +51,12 @@ class TimelogController < ApplicationController
       format.html {
         # Paginate results
         @entry_count = scope.count
-        @entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
+        @entry_pages = Paginator.new @entry_count, per_page_option, params['page']
         @entries = scope.all(
           :include => [:project, :activity, :user, {:issue => :tracker}],
           :order => sort_clause,
           :limit  =>  @entry_pages.items_per_page,
-          :offset =>  @entry_pages.current.offset
+          :offset =>  @entry_pages.offset
         )
         @total_hours = scope.sum(:hours).to_f
 
index 96c46fa36b0329145e34b1c10f685d42d8f17adb..698f48f3b6841c3ecd335f83b4288f4c9e011da4 100644 (file)
@@ -45,8 +45,8 @@ class UsersController < ApplicationController
     scope = scope.in_group(params[:group_id]) if params[:group_id].present?
 
     @user_count = scope.count
-    @user_pages = Paginator.new self, @user_count, @limit, params['page']
-    @offset ||= @user_pages.current.offset
+    @user_pages = Paginator.new @user_count, @limit, params['page']
+    @offset ||= @user_pages.offset
     @users =  scope.order(sort_clause).limit(@limit).offset(@offset).all
 
     respond_to do |format|
index 5567d1124fcf936f62a114997c133ef70783b1f5..53af94bd66c355c4d64c6e5d170d1d1a09190ba0 100644 (file)
@@ -212,13 +212,13 @@ class WikiController < ApplicationController
   # show page history
   def history
     @version_count = @page.content.versions.count
-    @version_pages = Paginator.new self, @version_count, per_page_option, params['page']
+    @version_pages = Paginator.new @version_count, per_page_option, params['page']
     # don't load text
     @versions = @page.content.versions.
       select("id, author_id, comments, updated_on, version").
       reorder('version DESC').
       limit(@version_pages.items_per_page + 1).
-      offset(@version_pages.current.offset).
+      offset(@version_pages.offset).
       all
 
     render :layout => false if request.xhr?
index f8e25afe79bf301fb46c3d8fb65f8fe51294462a..a848d8d6fe33c2a91d75c37515af4497bdd415a5 100644 (file)
@@ -142,7 +142,7 @@ module Redmine
       page_param = options[:parameter] || :page
       page = (params[page_param] || 1).to_i
       per_page = options[:per_page] || per_page_option
-      Paginator.new(self, item_count, per_page, page, page_param)
+      Paginator.new(item_count, per_page, page, page_param)
     end
 
     module Helper