From 4c45801ea09e8c6fd7009585e6ae0af0d36c2462 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 14 Feb 2019 02:17:15 +0900 Subject: [PATCH] Address to useless assignment `formats = nil` after #35254 https://codeclimate.com/github/rails/rails/pull/35254 --- actionview/lib/action_view/base.rb | 4 +--- actionview/test/fixtures/test/_first_layer.html.erb | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index fef4b4bbb0..712e5d251e 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -239,9 +239,7 @@ module ActionView #:nodoc: def initialize(lookup_context = nil, assigns = {}, controller = nil, formats = NULL) #:nodoc: @_config = ActiveSupport::InheritableOptions.new - if formats == NULL - formats = nil - else + unless formats == NULL ActiveSupport::Deprecation.warn <<~eowarn Passing formats to ActionView::Base.new is deprecated eowarn diff --git a/actionview/test/fixtures/test/_first_layer.html.erb b/actionview/test/fixtures/test/_first_layer.html.erb index 9f60d20e24..c1f1acb410 100644 --- a/actionview/test/fixtures/test/_first_layer.html.erb +++ b/actionview/test/fixtures/test/_first_layer.html.erb @@ -2,5 +2,3 @@ [ <%= render(partial: "first").chomp.html_safe %>, ]} - -