Skip to content
This repository
Browse code

Don't construct object deprecation proxy if unneeded

  • Loading branch information...
commit 2e053aec9bafa8735d70886f36dea06ea10dc4ce 1 parent 606cd61
Jeremy Kemper authored December 22, 2008
7  actionpack/lib/action_view/renderable_partial.rb
@@ -25,12 +25,11 @@ def render(view, local_assigns = {})
25 25
     end
26 26
 
27 27
     def render_partial(view, object = nil, local_assigns = {}, as = nil)
28  
-      object ||= local_assigns[:object] ||
29  
-        local_assigns[variable_name]
  28
+      object ||= local_assigns[:object] || local_assigns[variable_name]
30 29
 
31  
-      if view.respond_to?(:controller)
  30
+      if object.nil? && view.respond_to?(:controller)
32 31
         ivar = :"@#{variable_name}"
33  
-        object ||=
  32
+        object =
34 33
           if view.controller.instance_variable_defined?(ivar)
35 34
             ActiveSupport::Deprecation::DeprecatedObjectProxy.new(
36 35
               view.controller.instance_variable_get(ivar),

0 notes on commit 2e053ae

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