aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-09-05 15:59:25 +0200
committerJosé Valim <jose.valim@gmail.com>2010-09-05 15:59:35 +0200
commit8a3461b8c1cb6371c809618420de9e69a71d183f (patch)
tree8497bf27d75cb866c459cb58f8e68a008d759fec /actionpack/lib
parent9757bfff9b7fff21697228dd0920d8ea93fae969 (diff)
downloadrails-8a3461b8c1cb6371c809618420de9e69a71d183f.tar.gz
rails-8a3461b8c1cb6371c809618420de9e69a71d183f.tar.bz2
rails-8a3461b8c1cb6371c809618420de9e69a71d183f.zip
Remove a few tests from old router that do not make sense with the new one.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb24
1 files changed, 3 insertions, 21 deletions
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)