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

Key partial name cache on controller and object class *names* to avoid memory leaks in dev mode

This commit is contained in:
Jeremy Kemper 2010-04-02 15:54:38 -07:00
parent a1a3520198
commit ee7605ecf0

View file

@ -179,7 +179,7 @@ module ActionView
def initialize(view_context, options, block)
@view = view_context
@partial_names = PARTIAL_NAMES[@view.controller.class]
@partial_names = PARTIAL_NAMES[@view.controller.class.name]
setup(options, block)
end
@ -300,7 +300,7 @@ module ActionView
end
def partial_path(object = @object)
@partial_names[object.class] ||= begin
@partial_names[object.class.name] ||= begin
object = object.to_model if object.respond_to?(:to_model)
object.class.model_name.partial_path.dup.tap do |partial|