aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb2
-rw-r--r--railties/lib/rails/core.rb8
-rw-r--r--railties/lib/rails/initializer.rb8
3 files changed, 16 insertions, 2 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index d762689794..d3057aaa11 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -1,5 +1,3 @@
-require 'action_controller'
-
module Rails
class Application
def initialize
diff --git a/railties/lib/rails/core.rb b/railties/lib/rails/core.rb
index 33695a27b9..4c2789746c 100644
--- a/railties/lib/rails/core.rb
+++ b/railties/lib/rails/core.rb
@@ -14,6 +14,14 @@ module Rails
@@configuration = configuration
end
+ def application
+ @@application
+ end
+
+ def application=(application)
+ @@application = application
+ end
+
def initialized?
@initialized || false
end
diff --git a/railties/lib/rails/initializer.rb b/railties/lib/rails/initializer.rb
index b91e07d5c4..7501d4e0e2 100644
--- a/railties/lib/rails/initializer.rb
+++ b/railties/lib/rails/initializer.rb
@@ -1,5 +1,6 @@
require "pathname"
+require 'rails/application'
require 'rails/railties_path'
require 'rails/version'
require 'rails/gem_dependency'
@@ -89,12 +90,15 @@ module Rails
def run(initializer = nil)
Rails.configuration = Base.config = @config
+ Rails.application = nil
if initializer
run_initializer(initializer)
else
@initializers.each {|block| run_initializer(block) }
end
+
+ Rails.application
end
end
@@ -575,4 +579,8 @@ Run `rake gems:install` to install the missing gems.
Rails::Generators.options.deep_merge! config.generators.options
end
end
+
+ Initializer.default.add :build_application do
+ Rails.application = Rails::Application.new
+ end
end