Skip to content
Browse files

Remove more warnings: no need to define attr_accessor if already exis…

…ts. Initialize ivar.
  • Loading branch information...
1 parent 19d9fff commit 3f94b45262577b70a1d9f3aea45e0e4f07a2bbaa @miloops miloops committed Sep 28, 2010
Showing with 6 additions and 3 deletions.
  1. +5 −3 actionpack/lib/action_controller/test_case.rb
  2. +1 −0 actionpack/test/controller/render_test.rb
View
8 actionpack/lib/action_controller/test_case.rb
@@ -462,9 +462,11 @@ def build_request_uri(action, parameters)
# The exception is stored in the exception accessor for further inspection.
module RaiseActionExceptions
def self.included(base)
- base.class_eval do
- attr_accessor :exception
- protected :exception, :exception=
+ unless base.method_defined?(:exception) && base.method_defined?(:exception=)
+ base.class_eval do
+ attr_accessor :exception
+ protected :exception, :exception=
+ end
end
end
View
1 actionpack/test/controller/render_test.rb
@@ -327,6 +327,7 @@ def render_to_string_test
end
def default_render
+ @alternate_default_render ||= nil
if @alternate_default_render
@alternate_default_render.call
else

0 comments on commit 3f94b45

Please sign in to comment.
Something went wrong with that request. Please try again.