aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/environments/production.rb1
-rw-r--r--railties/environments/test.rb1
-rw-r--r--railties/lib/dispatcher.rb2
-rw-r--r--railties/lib/initializer.rb7
-rw-r--r--railties/test/initializer_test.rb8
-rw-r--r--railties/test/rails_info_controller_test.rb2
6 files changed, 8 insertions, 13 deletions
diff --git a/railties/environments/production.rb b/railties/environments/production.rb
index 27119d2d18..1fc9f6b923 100644
--- a/railties/environments/production.rb
+++ b/railties/environments/production.rb
@@ -7,7 +7,6 @@ config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
# See everything in the log (default is :info)
# config.log_level = :debug
diff --git a/railties/environments/test.rb b/railties/environments/test.rb
index d6f80a4080..496eb9572b 100644
--- a/railties/environments/test.rb
+++ b/railties/environments/test.rb
@@ -12,7 +12,6 @@ config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
-config.action_view.cache_template_loading = true
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb
index 9f8b59aa3d..7f9a6221d9 100644
--- a/railties/lib/dispatcher.rb
+++ b/railties/lib/dispatcher.rb
@@ -20,5 +20,5 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-require 'action_controller/dispatcher'
+require 'action_controller/dispatch/dispatcher'
Dispatcher = ActionController::Dispatcher
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index a04405a7c2..8eb4212737 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -378,8 +378,11 @@ Run `rake gems:install` to install the missing gems.
def load_view_paths
if configuration.frameworks.include?(:action_view)
- ActionController::Base.view_paths.load! if configuration.frameworks.include?(:action_controller)
- ActionMailer::Base.view_paths.load! if configuration.frameworks.include?(:action_mailer)
+ if configuration.cache_classes
+ view_path = ActionView::Template::EagerPath.new(configuration.view_path)
+ ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller)
+ ActionMailer::Base.template_root = view_path if configuration.frameworks.include?(:action_mailer)
+ end
end
end
diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb
index 561f7b8b54..d77a045e56 100644
--- a/railties/test/initializer_test.rb
+++ b/railties/test/initializer_test.rb
@@ -351,7 +351,7 @@ class InitializerDatabaseMiddlewareTest < Test::Unit::TestCase
def test_database_middleware_doesnt_initialize_when_session_store_is_not_active_record
store = ActionController::Base.session_store
- ActionController::Base.session_store = ActionController::Session::CookieStore
+ ActionController::Base.session_store = ActionDispatch::Session::CookieStore
# Define the class, so we don't have to actually make it load
eval("class ActiveRecord::ConnectionAdapters::ConnectionManagement; end")
@@ -380,12 +380,6 @@ class InitializerViewPathsTest < Test::Unit::TestCase
ActionMailer::Base.view_paths.expects(:load!).never
Rails::Initializer.run(:load_view_paths, @config)
end
-
- def test_load_view_paths_loads_view_paths
- ActionController::Base.view_paths.expects(:load!)
- ActionMailer::Base.view_paths.expects(:load!)
- Rails::Initializer.run(:load_view_paths, @config)
- end
end
class RailsRootTest < Test::Unit::TestCase
diff --git a/railties/test/rails_info_controller_test.rb b/railties/test/rails_info_controller_test.rb
index 607ece99a9..ab31f3a487 100644
--- a/railties/test/rails_info_controller_test.rb
+++ b/railties/test/rails_info_controller_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
require 'action_controller'
-require 'action_controller/test_process'
+require 'action_controller/testing/process'
require 'rails/info'
require 'rails/info_controller'