diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 1070128d00..09476ceadc 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -122,10 +122,8 @@ module ActionView extend Template::Handlers - attr_accessor :virtual_path - attr_reader :source, :identifier, :handler, :original_encoding, :updated_at - attr_reader :variable, :format, :variant, :locals + attr_reader :variable, :format, :variant, :locals, :virtual_path def initialize(source, identifier, handler, format: nil, variant: nil, locals: nil, **details) unless format @@ -158,6 +156,7 @@ module ActionView @compile_mutex = Mutex.new end + deprecate def virtual_path=(_); end deprecate def locals=(_); end deprecate def formats=(_); end deprecate def formats; Array(format); end diff --git a/actionview/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb index 312299b755..9ca028840f 100644 --- a/actionview/lib/action_view/template/resolver.rb +++ b/actionview/lib/action_view/template/resolver.rb @@ -187,18 +187,10 @@ module ActionView if key @cache.cache(key, name, prefix, partial, locals) do - decorate(yield, path_info, details, locals) + yield end else - decorate(yield, path_info, details, locals) - end - end - - # Ensures all the resolver information is set in the template. - def decorate(templates, path_info, details, locals) - cached = nil - templates.each do |t| - t.virtual_path ||= (cached ||= build_path(*path_info)) + yield end end end @@ -432,9 +424,5 @@ module ActionView def self.instances [new(""), new("/")] end - - def decorate(*) - super.each { |t| t.virtual_path = nil } - end end end