diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 14 | ||||
-rw-r--r-- | railties/lib/rails/engine/configurable.rb | 5 | ||||
-rw-r--r-- | railties/lib/rails/engine/configuration.rb | 3 |
5 files changed, 10 insertions, 20 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index a21b560084..05a26b64a8 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -147,12 +147,6 @@ module Rails self end - def app - @app ||= begin - config.middleware = config.middleware.merge_into(default_middleware_stack) - config.middleware.build(routes) - end - end alias :build_middleware_stack :app def call(env) diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 14669f47b7..a20208f8d5 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -11,7 +11,7 @@ module Rails :encoding, :consider_all_requests_local, :dependency_loading, :filter_parameters, :log_level, :logger, :preload_frameworks, :reload_plugins, - :secret_token, :session_options, + :secret_token, :serve_static_assets, :session_options, :time_zone, :whiny_nils def initialize(*) 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 diff --git a/railties/lib/rails/engine/configurable.rb b/railties/lib/rails/engine/configurable.rb index 0af01cace2..e668911913 100644 --- a/railties/lib/rails/engine/configurable.rb +++ b/railties/lib/rails/engine/configurable.rb @@ -21,11 +21,6 @@ module Rails def instance @instance ||= new end - - def endpoint(endpoint = nil) - @endpoint = endpoint if endpoint - @endpoint - end end def config diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index b1adbe1f22..06e7222753 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -5,12 +5,11 @@ module Rails class Configuration < ::Rails::Railtie::Configuration attr_reader :root attr_writer :eager_load_paths, :autoload_once_paths, :autoload_paths - attr_accessor :middleware, :plugins, :serve_static_assets + attr_accessor :middleware, :plugins def initialize(root=nil) super() @root = root - @serve_static_assets = true @middleware = Rails::Configuration::MiddlewareStackProxy.new end |