From 0fa0107d2d87f751c6768fa8a0991149134de2df Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 4 Feb 2019 13:21:18 -0800 Subject: Take in to account optional arguments when deprecating Refs: rails/jbuilder#452 --- actionview/lib/action_view/template/handlers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib/action_view/template/handlers.rb') diff --git a/actionview/lib/action_view/template/handlers.rb b/actionview/lib/action_view/template/handlers.rb index f2a2341b8e..ddaac7a100 100644 --- a/actionview/lib/action_view/template/handlers.rb +++ b/actionview/lib/action_view/template/handlers.rb @@ -43,7 +43,7 @@ module ActionView #:nodoc: handler.method(:call).parameters end - unless params.find_all { |type, _| type == :req }.length >= 2 + unless params.find_all { |type, _| type == :req || type == :opt }.length >= 2 ActiveSupport::Deprecation.warn <<~eowarn Single arity template handlers are deprecated. Template handlers must now accept two parameters, the view object and the source for the view object. -- cgit v1.2.3