diff options
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r-- | railties/lib/rails/application.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 14336d90c3..cadfc5010b 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -1,12 +1,20 @@ module Rails class Application - attr_accessor :middleware, :routes + attr_accessor :routes, :config + + def self.load(environment_file) + environment = File.read(environment_file) + Object.class_eval(environment, environment_file) + end def initialize - @middleware = ActionDispatch::MiddlewareStack.new @routes = ActionController::Routing::Routes end + def middleware + config.middleware + end + def call(env) @app ||= middleware.build(@routes) @app.call(env) |