From c555e28a4cf3690a95b5ed108d174f39cedd19b1 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Mon, 18 Mar 2019 10:12:41 -0700 Subject: Ignore nil in LookupContext#formats= This also removes the mutation we were performing on the values being passed in. --- actionview/lib/action_view/lookup_context.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionview/lib/action_view') 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 -- cgit v1.2.3