diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-15 06:40:39 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-15 06:40:39 +0000 |
commit | 40b7809de5394b1dd9ed29875131c880b65ff766 (patch) | |
tree | 752a2dbe2f794bedf9490d81b9b174a9e94f5692 /activerecord/lib | |
parent | 5dbf5ded5c5978b8ee87044c34c3e6ca6fc381a1 (diff) | |
download | rails-40b7809de5394b1dd9ed29875131c880b65ff766.tar.gz rails-40b7809de5394b1dd9ed29875131c880b65ff766.tar.bz2 rails-40b7809de5394b1dd9ed29875131c880b65ff766.zip |
Added check for RAILS_CONNECTION_ADAPTERS on startup and only load the connection adapters specified within if its present (available in Rails through config.connection_adapters using the new config) #1958 [skae]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2248 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index ac3f12239a..d7e7201e73 100755 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -63,11 +63,12 @@ ActiveRecord::Base.class_eval do include ActiveRecord::Acts::NestedSet end -require 'active_record/connection_adapters/mysql_adapter' -require 'active_record/connection_adapters/postgresql_adapter' -require 'active_record/connection_adapters/sqlite_adapter' -require 'active_record/connection_adapters/sqlserver_adapter' -require 'active_record/connection_adapters/db2_adapter' -require 'active_record/connection_adapters/oci_adapter' +unless defined?(RAILS_CONNECTION_ADAPTERS) + RAILS_CONNECTION_ADAPTERS = %w(mysql postgresql sqlite sqlserver db2 oci) +end + +RAILS_CONNECTION_ADAPTERS.each do |adapter| + require "active_record/connection_adapters/#{adapter}_adapter" +end -require 'active_record/query_cache' +require 'active_record/query_cache'
\ No newline at end of file |