Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6993

Show
Ignore:
Timestamp:
06/11/07 01:01:32 (2 years ago)
Author:
bitsweat
Message:

Deprecate pagination for Rails 1.2.4. Install the classic_pagination plugin for forward compatibility, or move to the superior will_paginate plugin. References #8157.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1-2-stable/actionpack/CHANGELOG

    r6803 r6993  
    11*SVN* 
     2 
     3* Deprecate pagination. Install the classic_pagination plugin for forward compatibility, or move to the superior will_paginate plugin.  #8157 [Mislav Marohnic] 
    24 
    35* Fix filtered parameter logging with nil parameter values.  #8422 [choonkeat] 
     
    466468* Avoid naming collision among compiled view methods. [Jeremy Kemper] 
    467469 
    468 * Fix CGI extensions when they expect string but get nil in Windows. Closes #5276 [mislav@nippur.irb.hr
     470* Fix CGI extensions when they expect string but get nil in Windows. Closes #5276 [Mislav Marohnic
    469471 
    470472* Determine the correct template_root for deeply nested components.  #2841 [s.brink@web.de] 
  • branches/1-2-stable/actionpack/lib/action_controller/pagination.rb

    r4953 r6993  
    22  # === Action Pack pagination for Active Record collections 
    33  # 
    4   # DEPRECATION WARNING: Pagination will be separated into its own plugin with Rails 2.0. 
     4  # DEPRECATION WARNING: Pagination will be moved to a plugin in Rails 2.0. 
     5  # Install the classic_pagination plugin for forward compatibility: 
     6  #   script/plugin install svn://errtheblog.com/svn/plugins/classic_pagination 
    57  # 
    68  # The Pagination module aids in the process of paging large collections of 
     
    131133    end 
    132134 
     135    deprecate :paginate => 'Pagination is moving to a plugin in Rails 2.0: script/plugin install svn://errtheblog.com/svn/plugins/classic_pagination' 
     136 
    133137    # These methods become class methods on any controller  
    134138    module ClassMethods 
     
    149153        end 
    150154      end 
     155 
     156      deprecate :paginate => 'Pagination is moving to a plugin in Rails 2.0: script/plugin install svn://errtheblog.com/svn/plugins/classic_pagination' 
    151157    end 
    152158 
  • branches/1-2-stable/actionpack/test/activerecord/pagination_test.rb

    r4807 r6993  
    66  class PaginationController < ActionController::Base 
    77    self.template_root = "#{File.dirname(__FILE__)}/../fixtures/" 
     8 
     9    around_filter :silence_deprecation_warnings 
    810     
    911    def simple_paginate 
     
    6769                                             :count => "d.id")         
    6870      render :nothing => true 
     71    end 
     72 
     73 
     74    def silence_deprecation_warnings 
     75      ActiveSupport::Deprecation.silence do 
     76        yield 
     77      end 
    6978    end 
    7079     
  • branches/1-2-stable/actionpack/test/controller/addresses_render_test.rb

    r4973 r6993  
    4040 
    4141  def test_list 
    42     get :list 
     42    # because pagination is deprecated 
     43    ActiveSupport::Deprecation.silence do 
     44      get :list 
     45    end 
    4346    assert_equal "We only need to get this far!", @response.body.chomp 
    4447  end 
  • branches/1-2-stable/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb

    r5758 r6993  
    22 
    33class DeprecatedBaseMethodsTest < Test::Unit::TestCase 
     4  # ActiveRecord model mock to test pagination deprecation 
     5  class DummyModel 
     6    def self.find(*args) [] end 
     7    def self.count(*args) 0 end 
     8  end 
     9 
    410  class Target < ActionController::Base 
    511    def deprecated_symbol_parameter_to_url_for 
     
    1925    end 
    2026 
     27    def pagination 
     28      paginate :dummy_models, :class_name => 'DeprecatedBaseMethodsTest::DummyModel' 
     29      render :nothing => true 
     30    end 
     31 
    2132    def rescue_action(e) raise e end 
    2233  end 
     
    2839    @response   = ActionController::TestResponse.new 
    2940    @controller = Target.new 
     41    @controller.logger = Logger.new(nil) unless @controller.logger 
    3042  end 
    3143 
     
    5870    assert_not_deprecated { error.message } 
    5971  end 
     72 
     73  def test_pagination_deprecation 
     74    assert_deprecated('svn://errtheblog.com/svn/plugins/classic_pagination') do 
     75      get :pagination 
     76    end 
     77  end 
    6078end