diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-23 07:05:51 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-23 07:05:51 +0000 |
commit | f78a1948d267ebacff381507980e1f331ad4a3fb (patch) | |
tree | 1f5fdc4012fab56503219aa7f4122bf1e8948885 /railties | |
parent | a11374ad5a48b76455b352b8336489e9f79b00b2 (diff) | |
download | rails-f78a1948d267ebacff381507980e1f331ad4a3fb.tar.gz rails-f78a1948d267ebacff381507980e1f331ad4a3fb.tar.bz2 rails-f78a1948d267ebacff381507980e1f331ad4a3fb.zip |
Don't load observers if Active Record isn't loaded.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6819 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/initializer.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index c34dbcdc5b..9f6f01d41c 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -216,7 +216,9 @@ module Rails end def load_observers - ActiveRecord::Base.instantiate_observers + if configuration.frameworks.include?(:active_record) + ActiveRecord::Base.instantiate_observers + end end # This initialzation sets $KCODE to 'u' to enable the multibyte safe operations. @@ -231,9 +233,10 @@ module Rails # this sets the database configuration from Configuration#database_configuration # and then establishes the connection. def initialize_database - return unless configuration.frameworks.include?(:active_record) - ActiveRecord::Base.configurations = configuration.database_configuration - ActiveRecord::Base.establish_connection + if configuration.frameworks.include?(:active_record) + ActiveRecord::Base.configurations = configuration.database_configuration + ActiveRecord::Base.establish_connection + end end # If the +RAILS_DEFAULT_LOGGER+ constant is already set, this initialization @@ -690,4 +693,4 @@ class Rails::OrderedOptions < Array #:nodoc: self.each { |i| return i if i.first == key } return false end -end
\ No newline at end of file +end |