From 8a3461b8c1cb6371c809618420de9e69a71d183f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 5 Sep 2010 15:59:25 +0200 Subject: Remove a few tests from old router that do not make sense with the new one. --- actionpack/lib/action_dispatch/routing/mapper.rb | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index fdcfe26781..8a161b0837 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -620,18 +620,9 @@ module ActionDispatch end def actions - only, except = @options.values_at(:only, :except) - if only == :all || except == :none - only = nil - except = [] - elsif only == :none || except == :all - only = [] - except = nil - end - - if only + if only = @options[:only] Array(only).map(&:to_sym) - elsif except + elsif except = @options[:except] default_actions - Array(except).map(&:to_sym) else default_actions @@ -783,7 +774,7 @@ module ActionDispatch end resource_scope(Resource.new(resources.pop, options)) do - instance_eval(&block) if block_given? + yield if block_given? collection_scope do get :index if parent_resource.actions.include?(:index) @@ -907,15 +898,6 @@ module ActionDispatch return self end - via = Array.wrap(options[:via]).map(&:to_sym) - if via.include?(:head) - raise ArgumentError, "HTTP method HEAD is invalid in route conditions. Rails processes HEAD requests the same as GETs, returning just the response headers" - end - - unless (invalid = via - HTTP_METHODS).empty? - raise ArgumentError, "Invalid HTTP method (#{invalid.join(', ')}) specified in :via" - end - on = options.delete(:on) if VALID_ON_OPTIONS.include?(on) args.push(options) -- cgit v1.2.3