mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove unused ActionController::Base.template_class. Closes #10787
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8985 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
5932357f19
commit
d7627361d3
4 changed files with 4 additions and 22 deletions
|
@ -1,5 +1,7 @@
|
||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* Remove unused ActionController::Base.template_class. Closes #10787 [Pratik]
|
||||||
|
|
||||||
* Moved template handlers related code from ActionView::Base to ActionView::Template. [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]
|
* Tests for div_for and content_tag_for helpers. Closes #11223 [thechrisoshow]
|
||||||
|
|
|
@ -58,7 +58,6 @@ require 'action_controller/request_forgery_protection'
|
||||||
require 'action_controller/headers'
|
require 'action_controller/headers'
|
||||||
|
|
||||||
require 'action_view'
|
require 'action_view'
|
||||||
ActionController::Base.template_class = ActionView::Base
|
|
||||||
|
|
||||||
ActionController::Base.class_eval do
|
ActionController::Base.class_eval do
|
||||||
include ActionController::Flash
|
include ActionController::Flash
|
||||||
|
|
|
@ -329,9 +329,6 @@ module ActionController #:nodoc:
|
||||||
# Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
|
# Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
|
||||||
cattr_accessor :logger
|
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.
|
# Turn on +ignore_missing_templates+ if you want to unit test actions without making the associated templates.
|
||||||
cattr_accessor :ignore_missing_templates
|
cattr_accessor :ignore_missing_templates
|
||||||
|
|
||||||
|
@ -1122,10 +1119,6 @@ module ActionController #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize_template_class(response)
|
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 = ActionView::Base.new(self.class.view_paths, {}, self)
|
||||||
response.template.extend self.class.master_helper_module
|
response.template.extend self.class.master_helper_module
|
||||||
response.redirected_to = nil
|
response.redirected_to = nil
|
||||||
|
@ -1225,7 +1218,7 @@ module ActionController #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_class_variables_to_assigns
|
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)
|
@assigns[cvar] = self.send(cvar)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,22 +46,10 @@ class HelperTest < Test::Unit::TestCase
|
||||||
eval("class #{controller_class_name} < TestController; end")
|
eval("class #{controller_class_name} < TestController; end")
|
||||||
@controller_class = self.class.const_get(controller_class_name)
|
@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.
|
# Set default test helper.
|
||||||
self.test_helper = LocalAbcHelper
|
self.test_helper = LocalAbcHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
|
||||||
# Reset template class.
|
|
||||||
#ActionController::Base.template_class = ActionView::Base
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def test_deprecated_helper
|
def test_deprecated_helper
|
||||||
assert_equal expected_helper_methods, missing_methods
|
assert_equal expected_helper_methods, missing_methods
|
||||||
assert_nothing_raised { @controller_class.helper TestHelper }
|
assert_nothing_raised { @controller_class.helper TestHelper }
|
||||||
|
|
Loading…
Reference in a new issue