diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-06-02 10:40:01 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-02 10:40:01 -0500 |
commit | 714d42d1a6140ac4f6fc478bf1766d2b0aedb251 (patch) | |
tree | 37810281abb34d856c2cf95513579d5f2096ed05 /railties/lib | |
parent | 185fe2e9cce737d69d3b47a656f3651ce152c0c1 (diff) | |
download | rails-714d42d1a6140ac4f6fc478bf1766d2b0aedb251.tar.gz rails-714d42d1a6140ac4f6fc478bf1766d2b0aedb251.tar.bz2 rails-714d42d1a6140ac4f6fc478bf1766d2b0aedb251.zip |
Fixed initializer tests by stubbing out gems dependencies check.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 11 |
1 files changed, 7 insertions, 4 deletions
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 |