1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make locals argument required on ActionView::Template#initialize

This commit is contained in:
Rafael Mendonça França 2020-05-05 19:08:13 -04:00
parent 71ddfd78d4
commit d25840eb49
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
3 changed files with 7 additions and 7 deletions

View file

@ -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`. * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
*Rafael Mendonça França* *Rafael Mendonça França*

View file

@ -117,12 +117,7 @@ module ActionView
attr_reader :identifier, :handler, :original_encoding, :updated_at attr_reader :identifier, :handler, :original_encoding, :updated_at
attr_reader :variable, :format, :variant, :locals, :virtual_path 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) def initialize(source, identifier, handler, locals:, format: nil, variant: nil, virtual_path: nil, updated_at: nil)
unless locals
ActiveSupport::Deprecation.warn "ActionView::Template#initialize requires a locals parameter"
locals = []
end
@source = source @source = source
@identifier = identifier @identifier = identifier
@handler = handler @handler = handler
@ -150,7 +145,6 @@ module ActionView
deprecate :original_encoding deprecate :original_encoding
deprecate :updated_at deprecate :updated_at
deprecate def virtual_path=(_); end deprecate def virtual_path=(_); end
deprecate def locals=(_); end
deprecate def formats=(_); end deprecate def formats=(_); end
deprecate def formats; Array(format); end deprecate def formats; Array(format); end
deprecate def variants=(_); end deprecate def variants=(_); end

View file

@ -55,6 +55,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
### Removals ### Removals
* Make `locals` argument required on `ActionView::Template#initialize`.
* Remove deprecated `ActionView::Template.finalize_compiled_template_methods`. * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
* Remove deprecated `config.action_view.finalize_compiled_template_methods` * Remove deprecated `config.action_view.finalize_compiled_template_methods`