diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-22 14:48:32 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-01-01 00:13:09 -0800 |
commit | 15702104a502d0d15bea454297260a495b15b62b (patch) | |
tree | 2d13b9fb1954d33cccca7503c38cc36e88ab15e3 /actionpack/lib/action_view | |
parent | 31fb733bae7bd07f3f45067671315e74dd83af22 (diff) | |
download | rails-15702104a502d0d15bea454297260a495b15b62b.tar.gz rails-15702104a502d0d15bea454297260a495b15b62b.tar.bz2 rails-15702104a502d0d15bea454297260a495b15b62b.zip |
Don't construct object deprecation proxy if unneeded
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/renderable_partial.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/renderable_partial.rb b/actionpack/lib/action_view/renderable_partial.rb index d92ff1b8d3..3ea836fa25 100644 --- a/actionpack/lib/action_view/renderable_partial.rb +++ b/actionpack/lib/action_view/renderable_partial.rb @@ -25,12 +25,11 @@ module ActionView end def render_partial(view, object = nil, local_assigns = {}, as = nil) - object ||= local_assigns[:object] || - local_assigns[variable_name] + object ||= local_assigns[:object] || local_assigns[variable_name] - if view.respond_to?(:controller) + if object.nil? && view.respond_to?(:controller) ivar = :"@#{variable_name}" - object ||= + object = if view.controller.instance_variable_defined?(ivar) ActiveSupport::Deprecation::DeprecatedObjectProxy.new( view.controller.instance_variable_get(ivar), |