Skip to content
2 changes: 1 addition & 1 deletion actionmailer/lib/action_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ def _deliver_all_later(delivery_method, *deliveries, **options)
ActiveSupport.on_load(:action_view) do
ActionView::Base.default_formats ||= Mime.symbols
ActionView::Template.mime_types_implementation = Mime
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
end
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,5 @@ def self.eager_load!
ActiveSupport.on_load(:action_view) do
ActionView::Base.default_formats ||= Mime.symbols
ActionView::Template.mime_types_implementation = Mime
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
end
4 changes: 2 additions & 2 deletions actionpack/test/controller/mime/respond_to_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def setup
Mime::Type.register("text/x-mobile", :mobile)
Mime::Type.register("application/fancy-xml", :fancy_xml)
Mime::Type.register("text/html; fragment", :html_fragment)
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
end

def teardown
Expand All @@ -345,7 +345,7 @@ def teardown
Mime::Type.unregister(:mobile)
Mime::Type.unregister(:fancy_xml)
Mime::Type.unregister(:html_fragment)
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
end

def test_html_fragment
Expand Down
4 changes: 2 additions & 2 deletions actionpack/test/controller/render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ def modify_template(name)
key = name + ".erb"
original = hash[key]
hash[key] = "#{original} Modified!"
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
yield
ensure
hash[key] = original
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
end
end

Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/cache_expiry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def deactivate

private
def reload!
ActionView::LookupContext::DetailsKey.clear
ActionView::LookupContext.clear
end

def build_watcher
Expand Down
14 changes: 14 additions & 0 deletions actionview/lib/action_view/digestor.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
# frozen_string_literal: true

require "concurrent/map"
require "action_view/dependency_tracker"

module ActionView
class Digestor
@@digest_mutex = Mutex.new
@cache = Concurrent::Map.new

class << self
def cache(details_key)
@cache[details_key] ||= Concurrent::Map.new
end

def digest_caches
@cache.values
end

def clear_cache
@cache.clear
end

# Supported options:
#
# * <tt>name</tt> - Template name
Expand Down
Loading
Loading