Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unused ActionController::Base.template_class. Closes #10787

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8985 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit d7627361d3e5c58653b9777eb81acf70c74bae8b 1 parent 5932357
@lifo lifo authored
View
2  actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Remove unused ActionController::Base.template_class. Closes #10787 [Pratik]
+
* Moved template handlers related code from ActionView::Base to ActionView::Template. [Pratik]
* Tests for div_for and content_tag_for helpers. Closes #11223 [thechrisoshow]
View
1  actionpack/lib/action_controller.rb
@@ -58,7 +58,6 @@
require 'action_controller/headers'
require 'action_view'
-ActionController::Base.template_class = ActionView::Base
ActionController::Base.class_eval do
include ActionController::Flash
View
9 actionpack/lib/action_controller/base.rb
@@ -329,9 +329,6 @@ class Base
# Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
cattr_accessor :logger
- # Determines which template class should be used by ActionController.
- cattr_accessor :template_class
-
# Turn on +ignore_missing_templates+ if you want to unit test actions without making the associated templates.
cattr_accessor :ignore_missing_templates
@@ -1122,10 +1119,6 @@ def render_for_text(text = nil, status = nil, append_response = false) #:nodoc:
end
def initialize_template_class(response)
- unless @@template_class
- raise "You must assign a template class through ActionController.template_class= before processing a request"
- end
-
response.template = ActionView::Base.new(self.class.view_paths, {}, self)
response.template.extend self.class.master_helper_module
response.redirected_to = nil
@@ -1225,7 +1218,7 @@ def add_instance_variables_to_assigns
end
def add_class_variables_to_assigns
- %w(view_paths logger template_class ignore_missing_templates).each do |cvar|
+ %w(view_paths logger ignore_missing_templates).each do |cvar|
@assigns[cvar] = self.send(cvar)
end
end
View
14 actionpack/test/controller/helper_test.rb
@@ -46,22 +46,10 @@ def setup
eval("class #{controller_class_name} < TestController; end")
@controller_class = self.class.const_get(controller_class_name)
- # Generate new template class and assign to controller.
- template_class_name = "Test#{@symbol}View"
- eval("class #{template_class_name} < ActionView::Base; end")
- @template_class = self.class.const_get(template_class_name)
- @controller_class.template_class = @template_class
-
# Set default test helper.
self.test_helper = LocalAbcHelper
end
-
- def teardown
- # Reset template class.
- #ActionController::Base.template_class = ActionView::Base
- end
-
-
+
def test_deprecated_helper
assert_equal expected_helper_methods, missing_methods
assert_nothing_raised { @controller_class.helper TestHelper }
Please sign in to comment.
Something went wrong with that request. Please try again.