aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-03-18 10:12:41 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-03-18 11:10:52 -0700
commitc555e28a4cf3690a95b5ed108d174f39cedd19b1 (patch)
tree4c089513e5fb87ce11790ae55c0f04f3f8a70e9b /actionview/lib
parent98d0f93506b0b97804d0d510ffcc435af9b2a2d5 (diff)
downloadrails-c555e28a4cf3690a95b5ed108d174f39cedd19b1.tar.gz
rails-c555e28a4cf3690a95b5ed108d174f39cedd19b1.tar.bz2
rails-c555e28a4cf3690a95b5ed108d174f39cedd19b1.zip
Ignore nil in LookupContext#formats=
This also removes the mutation we were performing on the values being passed in.
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/lookup_context.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb
index 2eaf188ecf..a0a2d41948 100644
--- a/actionview/lib/action_view/lookup_context.rb
+++ b/actionview/lib/action_view/lookup_context.rb
@@ -280,6 +280,7 @@ module ActionView
# add :html as fallback to :js.
def formats=(values)
if values
+ values = values.compact
values.concat(default_formats) if values.delete "*/*"
if values == [:js]
values << :html