From f9bea6304dfba902b1937b3bc29b1ebc2f67e55b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 23 Jan 2019 14:19:50 -0800 Subject: Move templates to an anonymous subclass of AV::Base Now we can throw away the subclass and the generated methods will get GC'd too --- actionview/lib/action_view/lookup_context.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionview/lib/action_view/lookup_context.rb') diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb index c2f6439e26..c3bb0a49fc 100644 --- a/actionview/lib/action_view/lookup_context.rb +++ b/actionview/lib/action_view/lookup_context.rb @@ -68,12 +68,17 @@ module ActionView end def self.clear + @view_context_class = nil @details_keys.clear end def self.digest_caches @details_keys.values end + + def self.view_context_class(klass) + @view_context_class ||= klass.with_empty_template_cache + end end # Add caching behavior on top of Details. -- cgit v1.2.3