Permalink
Browse files

Deprecated multi args to http route methods

  • Loading branch information...
1 parent 01176a7 commit e848c52535fa0f9488cdbdb3f1cedc7c7c02d643 @tenderlove tenderlove committed Jan 20, 2012
Showing with 13 additions and 1 deletion.
  1. +11 −0 actionpack/lib/action_dispatch/routing/mapper.rb
  2. +2 −1 actionpack/test/dispatch/routing_test.rb
@@ -2,6 +2,7 @@
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/inclusion'
require 'active_support/inflector'
+require 'active_support/deprecation'
require 'action_dispatch/routing/redirection'
module ActionDispatch
@@ -499,6 +500,16 @@ def delete(*args, &block)
private
def map_method(method, args, &block)
+ if args.length > 2
+ ActiveSupport::Deprecation.warn <<-eowarn
+The method signature of #{method}() is changing to:
+
+ #{method}(path, options = {})
+
+Calling with multiple paths is deprecated.
+ eowarn
+ end
+
options = args.extract_options!
options[:via] = method
match(*args, options, &block)
@@ -156,7 +156,8 @@ def self.call(params, request)
end
resources :posts do
- get :archive, :toggle_view, :on => :collection
+ get :archive, :on => :collection
+ get :toggle_view, :on => :collection
post :preview, :on => :member
resource :subscription

0 comments on commit e848c52

Please sign in to comment.