1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Don't construct object deprecation proxy if unneeded

This commit is contained in:
Jeremy Kemper 2008-12-22 14:48:32 -08:00
parent 606cd61b9a
commit 2e053aec9b

View file

@ -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),