1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Delegate App calls to instance

This commit is contained in:
Joshua Peek 2010-01-22 13:40:05 -06:00
parent d618b7e3dc
commit 2db14457f4
5 changed files with 11 additions and 5 deletions

View file

@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run <%= app_const %>.instance
run <%= app_const %>

View file

@ -2,4 +2,4 @@ require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands/console'
require File.expand_path('../../config/application', __FILE__)
Rails::Console.start(<%= app_const %>.instance)
Rails::Console.start(<%= app_const %>)

View file

@ -2,4 +2,4 @@ require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands/dbconsole'
require File.expand_path('../../config/application', __FILE__)
Rails::DBConsole.start(<%= app_const %>.instance)
Rails::DBConsole.start(<%= app_const %>)

View file

@ -8,7 +8,13 @@ module Rails
class << self
attr_writer :config
alias configure class_eval
delegate :initialize!, :load_tasks, :load_generators, :root, :to => :instance
delegate :call,
:initialize!,
:load_generators,
:load_tasks,
:middleware,
:root,
:to => :instance
private :new
def instance

View file

@ -76,7 +76,7 @@ module ApplicationTests
end
def middleware
AppTemplate::Application.instance.middleware.active.map(&:klass).map(&:name)
AppTemplate::Application.middleware.active.map(&:klass).map(&:name)
end
end
end