aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable_partial.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/renderable_partial.rb')
-rw-r--r--actionpack/lib/action_view/renderable_partial.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderable_partial.rb b/actionpack/lib/action_view/renderable_partial.rb
index 5203e57ead..123a9aebbc 100644
--- a/actionpack/lib/action_view/renderable_partial.rb
+++ b/actionpack/lib/action_view/renderable_partial.rb
@@ -27,8 +27,14 @@ module ActionView
def render_partial(view, object = nil, local_assigns = {}, as = nil)
object ||= local_assigns[:object] ||
- local_assigns[variable_name] ||
- view.controller.instance_variable_get("@#{variable_name}") if view.respond_to?(:controller)
+ local_assigns[variable_name]
+
+ if view.respond_to?(:controller)
+ object ||= ActiveSupport::Deprecation::DeprecatedObjectProxy.new(
+ view.controller.instance_variable_get("@#{variable_name}"),
+ "@#{variable_name} will no longer be implicitly assigned to #{variable_name}"
+ )
+ end
# Ensure correct object is reassigned to other accessors
local_assigns[:object] = local_assigns[variable_name] = object