From d25840eb498e165c338fbd088ee2c4c72449049f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 5 May 2020 19:08:13 -0400 Subject: [PATCH] Make `locals` argument required on `ActionView::Template#initialize` --- actionview/CHANGELOG.md | 4 ++++ actionview/lib/action_view/template.rb | 8 +------- guides/source/6_1_release_notes.md | 2 ++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index 65fdda0853..bf9d5829ed 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -1,3 +1,7 @@ +* Make `locals` argument required on `ActionView::Template#initialize`. + + *Rafael Mendonça França* + * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`. *Rafael Mendonça França* diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 520354563f..53a38b8767 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -117,12 +117,7 @@ module ActionView attr_reader :identifier, :handler, :original_encoding, :updated_at attr_reader :variable, :format, :variant, :locals, :virtual_path - def initialize(source, identifier, handler, format: nil, variant: nil, locals: nil, virtual_path: nil, updated_at: nil) - unless locals - ActiveSupport::Deprecation.warn "ActionView::Template#initialize requires a locals parameter" - locals = [] - end - + def initialize(source, identifier, handler, locals:, format: nil, variant: nil, virtual_path: nil, updated_at: nil) @source = source @identifier = identifier @handler = handler @@ -150,7 +145,6 @@ module ActionView deprecate :original_encoding deprecate :updated_at deprecate def virtual_path=(_); end - deprecate def locals=(_); end deprecate def formats=(_); end deprecate def formats; Array(format); end deprecate def variants=(_); end diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index 6026fe3766..fb23955f7c 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -55,6 +55,8 @@ Please refer to the [Changelog][action-pack] for detailed changes. ### Removals +* Make `locals` argument required on `ActionView::Template#initialize`. + * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`. * Remove deprecated `config.action_view.finalize_compiled_template_methods`