diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-01-23 14:19:50 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-06 16:52:15 -0800 |
commit | f9bea6304dfba902b1937b3bc29b1ebc2f67e55b (patch) | |
tree | 4859079e3b5c7055fb3b0b8b21bea08cd60de3f6 /actionview/lib/action_view/lookup_context.rb | |
parent | 9483cdee0a3ed9c686e338f079b0e369597b1211 (diff) | |
download | rails-f9bea6304dfba902b1937b3bc29b1ebc2f67e55b.tar.gz rails-f9bea6304dfba902b1937b3bc29b1ebc2f67e55b.tar.bz2 rails-f9bea6304dfba902b1937b3bc29b1ebc2f67e55b.zip |
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
Diffstat (limited to 'actionview/lib/action_view/lookup_context.rb')
-rw-r--r-- | actionview/lib/action_view/lookup_context.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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. |