diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-25 14:25:43 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-25 14:25:43 -0800 |
commit | bcf49299ff3afcb08ba5e155cedeb62a8b79f1fa (patch) | |
tree | 7e990e3a60c21b9d7b10595d67db26a4e357127e /actionview/lib/action_view/template | |
parent | c0c1441144aa5e477b3419b033e43c94adf7cc0c (diff) | |
download | rails-bcf49299ff3afcb08ba5e155cedeb62a8b79f1fa.tar.gz rails-bcf49299ff3afcb08ba5e155cedeb62a8b79f1fa.tar.bz2 rails-bcf49299ff3afcb08ba5e155cedeb62a8b79f1fa.zip |
Remove potential `variants` mutation in `decorate`
Even if the template is constructed with a `nil` variant, the array it
constructs will never be `empty?`:
https://github.com/rails/rails/blob/56b030605b4d968077a4ddb96b4ab619e75fb999/actionview/lib/action_view/template.rb#L152
We get an array that is `[nil]`, which is not empty, so this conditional
is never true.
Diffstat (limited to 'actionview/lib/action_view/template')
-rw-r--r-- | actionview/lib/action_view/template/resolver.rb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb index 220794e443..6f0bf4187e 100644 --- a/actionview/lib/action_view/template/resolver.rb +++ b/actionview/lib/action_view/template/resolver.rb @@ -196,7 +196,6 @@ module ActionView cached = nil templates.each do |t| t.locals = locals - t.variants = details[:variants] || [] if t.variants.empty? t.virtual_path ||= (cached ||= build_path(*path_info)) end end |