Skip to content

Commit

Permalink
Remove cvar for registered details
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Jun 29, 2021
1 parent c3fe14c commit eeea496
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions actionview/lib/action_view/lookup_context.rb
Expand Up @@ -15,7 +15,8 @@ module ActionView
class LookupContext #:nodoc:
attr_accessor :prefixes, :rendered_format

mattr_accessor :registered_details, default: []
singleton_class.attr_accessor :registered_details
self.registered_details = []

def self.register_detail(name, &block)
registered_details << name
Expand Down Expand Up @@ -176,7 +177,7 @@ def detail_args_for_any
@detail_args_for_any ||= begin
details = {}

registered_details.each do |k|
LookupContext.registered_details.each do |k|
if k == :variants
details[k] = :any
else
Expand Down Expand Up @@ -238,7 +239,7 @@ def with_prepended_formats(formats)
end

def initialize_details(target, details)
registered_details.each do |k|
LookupContext.registered_details.each do |k|
target[k] = details[k] || Accessors::DEFAULT_PROCS[k].call
end
target
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/renderer/abstract_renderer.rb
Expand Up @@ -158,7 +158,7 @@ def format

def extract_details(options) # :doc:
details = nil
@lookup_context.registered_details.each do |key|
LookupContext.registered_details.each do |key|
value = options[key]

if value
Expand Down

0 comments on commit eeea496

Please sign in to comment.