diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2016-02-18 09:23:59 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2016-02-18 09:23:59 -0800 |
commit | 3bd9fe1708018e4e82f5d836cc6e047d9d9b5b55 (patch) | |
tree | 831d9c6d3379747174c2ea2e0b9d572f623c9764 /actionview/lib/action_view/lookup_context.rb | |
parent | cbaae13430a90fdb24b1f54a52501d88828af723 (diff) | |
parent | 3239ed48d28f3c0baf4445e6c279107e892b7cab (diff) | |
download | rails-3bd9fe1708018e4e82f5d836cc6e047d9d9b5b55.tar.gz rails-3bd9fe1708018e4e82f5d836cc6e047d9d9b5b55.tar.bz2 rails-3bd9fe1708018e4e82f5d836cc6e047d9d9b5b55.zip |
Merge pull request #23756 from tenderlove/move_digest_cache
move digest cache on to the DetailsKey object
Diffstat (limited to 'actionview/lib/action_view/lookup_context.rb')
-rw-r--r-- | actionview/lib/action_view/lookup_context.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb index 2a1f4378f5..86afedaa2d 100644 --- a/actionview/lib/action_view/lookup_context.rb +++ b/actionview/lib/action_view/lookup_context.rb @@ -69,6 +69,18 @@ module ActionView def self.clear @details_keys.clear end + + def self.empty?; @details_keys.empty?; end + + def self.digest_caches + @details_keys.values.map(&:digest_cache) + end + + attr_reader :digest_cache + + def initialize + @digest_cache = Concurrent::Map.new + end end # Add caching behavior on top of Details. @@ -194,6 +206,10 @@ module ActionView self.view_paths = view_paths end + def digest_cache + details_key.digest_cache + end + def initialize_details(target, details) registered_details.each do |k| target[k] = details[k] || Accessors::DEFAULT_PROCS[k].call |