diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-29 10:04:42 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-29 10:04:42 +0200 |
commit | 0bbf9029e8089356aed0e3be2f859d56951a89cf (patch) | |
tree | 38e41ef8b63140a91c828bec03e06e83f38899b6 /actionpack/lib/action_view | |
parent | 006cef7107b648882cfc09f56904c601454cfc77 (diff) | |
parent | 17599abc9c06f30ff23d7ad47a3f029e32c26c88 (diff) | |
download | rails-0bbf9029e8089356aed0e3be2f859d56951a89cf.tar.gz rails-0bbf9029e8089356aed0e3be2f859d56951a89cf.tar.bz2 rails-0bbf9029e8089356aed0e3be2f859d56951a89cf.zip |
Merge remote branch 'miloops/warnings'
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/error.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 6 |
4 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 8bae6d2796..7e49052c24 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -991,7 +991,11 @@ module ActionView end def object - @object || @template_object.instance_variable_get("@#{@object_name}") + if @object + @object + elsif @template_object.instance_variable_defined?("@#{@object_name}") + @template_object.instance_variable_get("@#{@object_name}") + end rescue NameError # As @object_name may contain the nested syntax (item[subobject]) we # need to fallback to nil. diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb index b1839b65e5..423e1e0bf5 100644 --- a/actionpack/lib/action_view/template/error.rb +++ b/actionpack/lib/action_view/template/error.rb @@ -52,6 +52,7 @@ module ActionView def initialize(template, assigns, original_exception) @template, @assigns, @original_exception = template, assigns.dup, original_exception + @sub_templates = nil @backtrace = original_exception.backtrace end diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index c9e20ca14e..a261e08dbc 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -6,6 +6,7 @@ module ActionView # = Action View Resolver class Resolver def initialize + @path = nil @cached = Hash.new { |h1,k1| h1[k1] = Hash.new { |h2,k2| h2[k2] = Hash.new { |h3, k3| h3[k3] = {} } } } end diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 32fd8c5e21..de23a67cb6 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -137,8 +137,10 @@ module ActionView def make_test_case_available_to_view! test_case_instance = self _helpers.module_eval do - define_method(:_test_case) { test_case_instance } - private :_test_case + unless private_method_defined?(:_test_case) + define_method(:_test_case) { test_case_instance } + private :_test_case + end end end |