Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed deprecated router API from railties

  • Loading branch information...
commit e6b93fa6db645d0acf18fc36d99ac8e13cb2091a 1 parent 7c50454
@drogus drogus authored
View
11 railties/lib/rails/engine.rb
@@ -399,17 +399,6 @@ def config
end
end
- # DEPRECATED: Remove in 3.1
- initializer :add_routing_namespaces do |app|
- paths.app.controllers.to_a.each do |load_path|
- load_path = File.expand_path(load_path)
- Dir["#{load_path}/*/**/*_controller.rb"].collect do |path|
- namespace = File.dirname(path).sub(/#{Regexp.escape(load_path)}\/?/, '')
- app.routes.controller_namespaces << namespace unless namespace.empty?
- end
- end
- end
-
# I18n load paths are a special case since the ones added
# later have higher priority.
initializer :add_locales do
View
4 railties/test/application/initializers/i18n_test.rb
@@ -74,7 +74,7 @@ def assert_no_fallbacks
YAML
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match '/i18n', :to => lambda { |env| [200, {}, [I18n.t(:foo)]] }
end
RUBY
@@ -147,4 +147,4 @@ def assert_no_fallbacks
assert_fallbacks :ca => [:ca, :"es-ES", :es, :'en-US', :en]
end
end
-end
+end
View
2  railties/test/application/loading_test.rb
@@ -70,7 +70,7 @@ class Post < ActiveRecord::Base
MODEL
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match '/load', :to => lambda { |env| [200, {}, Post.all] }
match '/unload', :to => lambda { |env| [200, {}, []] }
end
View
16 railties/test/application/routing_test.rb
@@ -33,7 +33,7 @@ def index
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match ':controller(/:action)'
end
RUBY
@@ -91,7 +91,7 @@ def foo_or_bar?
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match ':controller(/:action)'
end
RUBY
@@ -102,7 +102,7 @@ def foo_or_bar?
test "mount rack app" do
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
mount lambda { |env| [200, {}, [env["PATH_INFO"]]] }, :at => "/blog"
# The line below is required because mount sometimes
# fails when a resource route is added.
@@ -132,7 +132,7 @@ def index
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match ':controller(/:action)'
end
RUBY
@@ -164,7 +164,7 @@ def index
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match 'admin/foo', :to => 'admin/foo#index'
match 'foo', :to => 'foo#index'
end
@@ -192,7 +192,7 @@ def baz
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match 'foo', :to => 'foo#bar'
end
RUBY
@@ -223,7 +223,7 @@ def baz
end
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match 'foo', :to => ::InitializeRackApp
end
RUBY
@@ -240,7 +240,7 @@ def baz
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
resources :yazilar
end
RUBY
View
2  railties/test/railties/mounted_engine_test.rb
@@ -14,7 +14,7 @@ def setup
@plugin = engine "blog"
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match "/engine_route" => "application_generating#engine_route"
match "/engine_route_in_view" => "application_generating#engine_route_in_view"
match "/url_for_engine_route" => "application_generating#url_for_engine_route"
View
4 railties/test/railties/shared_tests.rb
@@ -178,7 +178,7 @@ def index
RUBY
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match 'foo', :to => 'foo#index'
end
RUBY
@@ -192,7 +192,7 @@ def index
RUBY
@plugin.write "config/routes.rb", <<-RUBY
- Rails.application.routes.draw do |map|
+ Rails.application.routes.draw do
match 'foo', :to => 'bar#index'
match 'bar', :to => 'bar#index'
end
Please sign in to comment.
Something went wrong with that request. Please try again.