Skip to content

Commit d9182c0

Browse files
committed
config should always be an AS::InheritableOptions object. Closes rails#1992
1 parent ea4b94a commit d9182c0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

actionpack/lib/action_view/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def assign(new_assigns) # :nodoc:
194194
end
195195

196196
def initialize(context = nil, assigns = {}, controller = nil, formats = nil) #:nodoc:
197-
@_config = {}
197+
@_config = ActiveSupport::InheritableOptions.new
198198

199199
# Handle all these for backwards compatibility.
200200
# TODO Provide a new API for AV::Base and deprecate this one.

actionpack/test/template/test_case_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class GeneralViewTest < ActionView::TestCase
4545
assert_same _view, view
4646
end
4747

48+
test "retrieve non existing config values" do
49+
assert_equal nil, ActionView::Base.new.config.something_odd
50+
end
51+
4852
test "works without testing a helper module" do
4953
assert_equal 'Eloy', render('developers/developer', :developer => stub(:name => 'Eloy'))
5054
end

0 commit comments

Comments
 (0)