diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-22 14:48:32 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-22 14:48:45 -0800 |
commit | 2e053aec9bafa8735d70886f36dea06ea10dc4ce (patch) | |
tree | c1de3395b64091ade308b6868131d80e1213632b /actionpack | |
parent | 606cd61b9a2a710a27c2e482b5dace100cce9779 (diff) | |
download | rails-2e053aec9bafa8735d70886f36dea06ea10dc4ce.tar.gz rails-2e053aec9bafa8735d70886f36dea06ea10dc4ce.tar.bz2 rails-2e053aec9bafa8735d70886f36dea06ea10dc4ce.zip |
Don't construct object deprecation proxy if unneeded
Diffstat (limited to 'actionpack')
-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), |