Permalink
Browse files

Fix @renderer warning

  • Loading branch information...
1 parent 2fbd6f4 commit 97be8537ebf33aa0c47fe1c6164e94c24acc3c19 @josh josh committed Dec 2, 2009
Showing with 10 additions and 10 deletions.
  1. +10 −10 actionpack/lib/action_view/render/partials.rb
@@ -181,20 +181,20 @@ class PartialRenderer
def initialize(view_context, options, block)
@view = view_context
@partial_names = PARTIAL_NAMES[@view.controller.class]
-
+
key = Thread.current[:format_locale_key]
@templates = TEMPLATES[key] if key
-
+
setup(options, block)
end
-
+
def setup(options, block)
partial = options[:partial]
-
+
@options = options
@locals = options[:locals] || {}
@block = block
-
+
if String === partial
@object = options[:object]
@path = partial
@@ -240,7 +240,7 @@ def collection_with_template(template)
segments << template.render(@view, locals)
end
-
+
@template = template
segments
end
@@ -294,7 +294,7 @@ def find_template(path = @path)
path && @templates[path] ||= _find_template(path)
end
end
-
+
def _find_template(path)
if controller = @view.controller
prefix = controller.controller_path unless path.include?(?/)
@@ -319,7 +319,7 @@ def render_partial(options)
_evaluate_assigns_and_ivars
details = options[:_details]
-
+
# Is this needed
self.formats = details[:formats] if details
renderer = PartialRenderer.new(self, options, nil)
@@ -329,12 +329,12 @@ def render_partial(options)
end
def _render_partial(options, &block) #:nodoc:
- if @renderer
+ if defined? @renderer
@renderer.setup(options, block)
else
@renderer = PartialRenderer.new(self, options, block)
end
-
+
@renderer.render
end

0 comments on commit 97be853

Please sign in to comment.