Skip to content

Commit 12cce89

Browse files
committed
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
1 parent f500e27 commit 12cce89

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

actionpack/lib/abstract_controller/base.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
require 'erubis'
2+
require 'abstract_controller/error'
23
require 'active_support/configurable'
34
require 'active_support/descendants_tracker'
45
require 'active_support/core_ext/module/anonymous'
56
require 'active_support/core_ext/module/attr_internal'
67

78
module AbstractController
8-
class Error < StandardError #:nodoc:
9-
end
10-
119
# Raised when a non-existing controller action is triggered.
1210
class ActionNotFound < StandardError
1311
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module AbstractController
2+
class Error < StandardError #:nodoc:
3+
end
4+
end

actionpack/lib/abstract_controller/rendering.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'abstract_controller/error'
12
require 'active_support/concern'
23
require 'active_support/core_ext/class/attribute'
34
require 'action_view'

actionview/lib/action_view/view_paths.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'action_view/base'
2-
31
module ActionView
42
module ViewPaths
53
extend ActiveSupport::Concern

0 commit comments

Comments
 (0)