diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-17 01:38:58 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-17 01:38:58 +0000 |
commit | 4249ffe2498e9a77242205f95245ba1fcca92732 (patch) | |
tree | bfd91a2843f294d4b991dfed2678eb4625f75f76 /railties/environments | |
parent | 24c9250968dda116f1383de75b08cd0bf37ad394 (diff) | |
download | rails-4249ffe2498e9a77242205f95245ba1fcca92732.tar.gz rails-4249ffe2498e9a77242205f95245ba1fcca92732.tar.bz2 rails-4249ffe2498e9a77242205f95245ba1fcca92732.zip |
Load config/preinitializer.rb, if present, before loading the environment. Closes #9943.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/environments')
-rw-r--r-- | railties/environments/boot.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/railties/environments/boot.rb b/railties/environments/boot.rb index 7591290447..518a8883c1 100644 --- a/railties/environments/boot.rb +++ b/railties/environments/boot.rb @@ -6,7 +6,10 @@ RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) module Rails class << self def boot! - pick_boot.run unless booted? + unless booted? + preinitialize + pick_boot.run + end end def booted? @@ -20,6 +23,14 @@ module Rails def vendor_rails? File.exist?("#{RAILS_ROOT}/vendor/rails") end + + def preinitialize + load(preinitializer_path) if File.exists?(preinitializer_path) + end + + def preinitializer_path + "#{RAILS_ROOT}/config/preinitializer.rb" + end end class Boot |