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:
parent
606cd61b9a
commit
2e053aec9b
1 changed files with 3 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue