aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/initializer.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 8e99c708c2..5b80ab5bd5 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -30,6 +30,7 @@ module Rails
def process
set_load_path
+ set_connection_adapters
require_frameworks
load_environment
@@ -56,6 +57,10 @@ module Rails
$LOAD_PATH.uniq!
end
+ def set_connection_adapters
+ RAILS_CONNECTION_ADAPTERS = configuration.connection_adapters
+ end
+
def require_frameworks
configuration.frameworks.each { |framework| require(framework.to_s) }
end
@@ -143,6 +148,7 @@ module Rails
class Configuration
attr_accessor :frameworks, :load_paths, :logger, :log_level, :log_path, :database_configuration_file, :view_path, :controller_paths
attr_accessor :cache_classes, :breakpoint_server, :whiny_nils
+ attr_accessor :connection_adapters
attr_accessor :active_record, :action_controller, :action_view, :action_mailer, :action_web_service
def initialize
@@ -155,6 +161,7 @@ module Rails
self.cache_classes = default_cache_classes
self.breakpoint_server = default_breakpoint_server
self.whiny_nils = default_whiny_nils
+ self.connection_adapters = default_connection_adapters
self.database_configuration_file = default_database_configuration_file
for framework in default_frameworks
@@ -258,5 +265,9 @@ module Rails
def default_whiny_nils
false
end
+
+ def default_connection_adapters
+ %w(mysql postgresql sqlite sqlserver db2 oci)
+ end
end
end