From b3eb26a161acb23781e55fc6c37b948f160cd9b5 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 5 Aug 2010 15:44:23 +0200 Subject: Removed deprecated RouteSet API, still many tests fail --- actionpack/lib/action_dispatch/routing.rb | 1 - actionpack/lib/action_dispatch/routing/mapper.rb | 7 +------ actionpack/lib/action_dispatch/routing/route_set.rb | 12 +++--------- 3 files changed, 4 insertions(+), 16 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing.rb b/actionpack/lib/action_dispatch/routing.rb index b2b0f4c08e..8810227a59 100644 --- a/actionpack/lib/action_dispatch/routing.rb +++ b/actionpack/lib/action_dispatch/routing.rb @@ -264,7 +264,6 @@ module ActionDispatch # Target specific controllers by prefixing the command with CONTROLLER=x. # module Routing - autoload :DeprecatedMapper, 'action_dispatch/routing/deprecated_mapper' autoload :Mapper, 'action_dispatch/routing/mapper' autoload :Route, 'action_dispatch/routing/route' autoload :RouteSet, 'action_dispatch/routing/route_set' diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 900900ee24..cee3fd880c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -443,11 +443,6 @@ module ActionDispatch options = args.extract_options! options = options.dup - if name_prefix = options.delete(:name_prefix) - options[:as] ||= name_prefix - ActiveSupport::Deprecation.warn ":name_prefix was deprecated in the new router syntax. Use :as instead.", caller - end - options[:path] = args.first if args.first.is_a?(String) recover = {} @@ -770,7 +765,7 @@ module ActionDispatch end resource_scope(Resource.new(resources.pop, options)) do - yield if block_given? + instance_eval(&block) if block_given? collection_scope do get :index if parent_resource.actions.include?(:index) diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 107e44287d..956bd2e719 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -1,7 +1,6 @@ require 'rack/mount' require 'forwardable' require 'active_support/core_ext/object/to_query' -require 'action_dispatch/routing/deprecated_mapper' module ActionDispatch module Routing @@ -211,7 +210,6 @@ module ActionDispatch self.routes = [] self.named_routes = NamedRouteCollection.new self.resources_path_names = self.class.default_resources_path_names.dup - self.controller_namespaces = Set.new self.default_url_options = {} self.request_class = request_class @@ -227,14 +225,10 @@ module ActionDispatch clear! unless @disable_clear_and_finalize mapper = Mapper.new(self) - if block.arity == 1 - mapper.instance_exec(DeprecatedMapper.new(self), &block) + if default_scope + mapper.with_default_scope(default_scope, &block) else - if default_scope - mapper.with_default_scope(default_scope, &block) - else - mapper.instance_exec(&block) - end + mapper.instance_exec(&block) end finalize! unless @disable_clear_and_finalize -- cgit v1.2.3