From 3939d6bb51fc36ac863f0e4766ed8d87fad98297 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 8 Jul 2010 12:07:25 +0200 Subject: Removed ActionDispatch::Static, but left empty MiddlewareStack to unify app method between Engine and Application --- railties/lib/rails/engine.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'railties/lib/rails/engine.rb') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 409502cb08..a602dac5ff 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -124,6 +124,11 @@ module Rails Pathname.new(root).expand_path : Pathname.new(root).realpath end + def endpoint(endpoint = nil) + @endpoint = endpoint if endpoint + @endpoint + end + protected def method_missing(*args, &block) @@ -162,12 +167,6 @@ module Rails self.class.endpoint || routes end - def default_middleware_stack - ActionDispatch::MiddlewareStack.new.tap do |middleware| - middleware.use ::ActionDispatch::Static, paths.public.to_a.first if config.serve_static_assets - end - end - def call(env) app.call(env) end @@ -251,6 +250,9 @@ module Rails end protected + def default_middleware_stack + ActionDispatch::MiddlewareStack.new + end def _all_autoload_paths @_all_autoload_paths ||= (config.autoload_paths + config.eager_load_paths + config.autoload_once_paths).uniq -- cgit v1.2.3