Permalink
Browse files

Break up a circular require between AP/AV

Right now referencing the constant `AbstractController::Rendering`
causes `ActionView::Base` to be loaded, and thus the load hooks for
action_view are run. If that load hook references any part of action
view that then references action controller (such as
`ActionView::TestCase`), the constant `AbstractController::Rendering`
will attempt to be autoloaded and blow up.

With this change, `ActionView::LoadPaths` no longer requires
`ActionView::Base` (which it had no reason to require). There was a
needed class from `AbstractController::Base` in the Rendering module,
which I've moved into its own file so we don't need to load
all of `AbstractController::Base` there.

This commit fixes
rails/rails-controller-testing#21
  • Loading branch information...
sgrif committed Mar 11, 2016
1 parent f500e27 commit 12cce89c89b48b15dcf2fcdb41feaaa5b7c06991
@@ -1,13 +1,11 @@
require 'erubis'
require 'abstract_controller/error'
require 'active_support/configurable'
require 'active_support/descendants_tracker'
require 'active_support/core_ext/module/anonymous'
require 'active_support/core_ext/module/attr_internal'
module AbstractController
class Error < StandardError #:nodoc:
end
# Raised when a non-existing controller action is triggered.
class ActionNotFound < StandardError
end
@@ -0,0 +1,4 @@
module AbstractController
class Error < StandardError #:nodoc:
end
end
@@ -1,3 +1,4 @@
require 'abstract_controller/error'
require 'active_support/concern'
require 'active_support/core_ext/class/attribute'
require 'action_view'
@@ -1,5 +1,3 @@
require 'action_view/base'
module ActionView
module ViewPaths
extend ActiveSupport::Concern

0 comments on commit 12cce89

Please sign in to comment.