diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb index 5ba4173164907..df539e0c6dfce 100644 --- a/actionpack/lib/action_view/lookup_context.rb +++ b/actionpack/lib/action_view/lookup_context.rb @@ -50,9 +50,20 @@ class DetailsKey #:nodoc: @details_keys = Hash.new def self.get(details) + if details[:formats] + details = details.dup + syms = Set.new Mime::SET.symbols + details[:formats] = details[:formats].select { |v| + syms.include? v + } + end @details_keys[details.freeze] ||= new end + def self.clear + @details_keys.clear + end + def initialize @hash = object_hash end