aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/environments/shared.rb4
-rw-r--r--railties/environments/shared_for_gem.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/railties/environments/shared.rb b/railties/environments/shared.rb
index 985d06ebe9..78628341e8 100644
--- a/railties/environments/shared.rb
+++ b/railties/environments/shared.rb
@@ -37,8 +37,9 @@ require 'action_mailer'
# Environment-specific configuration.
-require 'yaml'
ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
+ActiveRecord::Base.establish_connection
+
ActionController::Base.require_or_load 'abstract_application'
ActionController::Base.require_or_load "environments/#{RAILS_ENV}"
@@ -52,5 +53,4 @@ end
klass.template_root ||= "#{RAILS_ROOT}/app/views/"
end
-
# Include your app's configuration here:
diff --git a/railties/environments/shared_for_gem.rb b/railties/environments/shared_for_gem.rb
index 52f618563c..dde6a01db7 100644
--- a/railties/environments/shared_for_gem.rb
+++ b/railties/environments/shared_for_gem.rb
@@ -33,8 +33,9 @@ require_gem 'rails'
# Environment-specific configuration.
-require 'yaml'
ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
+ActiveRecord::Base.establish_connection
+
ActionController::Base.require_or_load 'abstract_application'
ActionController::Base.require_or_load "environments/#{RAILS_ENV}"