diff options
Diffstat (limited to 'railties/environments/boot.rb')
-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 |