aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template/resolver.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-02-25 16:33:05 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-02-25 16:33:05 -0800
commit9a343d148b96874a231b87906c9d6499b5e0b64a (patch)
tree929e172f35029976508c0603f0d923321bc530c4 /actionview/lib/action_view/template/resolver.rb
parentd4015a7f0609f12a5f7be4c794e5c5eaf2c748d5 (diff)
downloadrails-9a343d148b96874a231b87906c9d6499b5e0b64a.tar.gz
rails-9a343d148b96874a231b87906c9d6499b5e0b64a.tar.bz2
rails-9a343d148b96874a231b87906c9d6499b5e0b64a.zip
Don't mutate `virtual_path`, remove `decorate`
`virtual_path` is calculated in the constructor when the Template object is allocated. We don't actually need to set it in the `decorate` method. That means we can remove the decorate method all together.
Diffstat (limited to 'actionview/lib/action_view/template/resolver.rb')
-rw-r--r--actionview/lib/action_view/template/resolver.rb16
1 files changed, 2 insertions, 14 deletions
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