Permalink
Browse files

Merge pull request #1527 from guilleiguaran/3-1-stable

Rails::Server#app should be nice with Rack::URLMap (3.1 stable)
  • Loading branch information...
2 parents 645f138 + 8d758d8 commit 69b25ebb2bb81c387fa4c9fd97fa3e66b0674441 @josevalim josevalim committed Jun 7, 2011
Showing with 5 additions and 1 deletion.
  1. +4 −0 railties/lib/rails/application.rb
  2. +1 −1 railties/lib/rails/commands/server.rb
@@ -138,6 +138,10 @@ def config
@config ||= Application::Configuration.new(find_root_with_flag("config.ru", Dir.pwd))
end
+ def to_app
+ self
+ end
+
protected
alias :build_middleware_stack :app
@@ -43,7 +43,7 @@ def initialize(*)
end
def app
- @app ||= super.instance
+ @app ||= super.respond_to?(:to_app) ? super.to_app : super
end
def opt_parser

0 comments on commit 69b25eb

Please sign in to comment.