From 714d42d1a6140ac4f6fc478bf1766d2b0aedb251 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 2 Jun 2008 10:40:01 -0500 Subject: Fixed initializer tests by stubbing out gems dependencies check. --- railties/lib/initializer.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index bdadfeea8f..9e6e02e8e0 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -79,7 +79,10 @@ module Rails # The set of loaded plugins. attr_reader :loaded_plugins - + + # Whether or not all the gem dependencies have been met + attr_reader :gems_dependencies_loaded + # Runs the initializer. By default, this will invoke the #process method, # which simply executes all of the initialization routines. Alternately, # you can specify explicitly which initialization routine you want: @@ -307,7 +310,7 @@ module Rails end def load_observers - if @gems_dependencies_loaded && configuration.frameworks.include?(:active_record) + if gems_dependencies_loaded && configuration.frameworks.include?(:active_record) ActiveRecord::Base.instantiate_observers end end @@ -463,7 +466,7 @@ module Rails # Fires the user-supplied after_initialize block (Configuration#after_initialize) def after_initialize - if @gems_dependencies_loaded + if gems_dependencies_loaded configuration.after_initialize_blocks.each do |block| block.call end @@ -471,7 +474,7 @@ module Rails end def load_application_initializers - if @gems_dependencies_loaded + if gems_dependencies_loaded Dir["#{configuration.root_path}/config/initializers/**/*.rb"].sort.each do |initializer| load(initializer) end -- cgit v1.2.3