From 2f128a82e66f181577ff77d83d4ca02659aa8a8d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 25 Feb 2019 11:53:55 -0800 Subject: Always pass a format to the ActionView::Template constructor This means we can eliminate nil checks and remove some mutations from the `decorate` method. --- actionview/lib/action_view/template.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'actionview/lib/action_view/template.rb') diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 133a316405..9e8f17d746 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -128,8 +128,11 @@ module ActionView attr_reader :variable - def initialize(source, identifier, handler, details) - format = details[:format] || (handler.default_format if handler.respond_to?(:default_format)) + def initialize(source, identifier, handler, format: nil, **details) + unless format + ActiveSupport::Deprecation.warn "ActionView::Template#initialize requires a format parameter" + format = :html + end @source = source @identifier = identifier -- cgit v1.2.3