diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-04 13:21:18 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-04 13:21:24 -0800 |
commit | 0fa0107d2d87f751c6768fa8a0991149134de2df (patch) | |
tree | 38ac264dbc70dbf34ae0ad89d47b85d98c75e4bd /actionview/lib | |
parent | cc2d614e6310337a9d34ede3e67d634d84561cde (diff) | |
download | rails-0fa0107d2d87f751c6768fa8a0991149134de2df.tar.gz rails-0fa0107d2d87f751c6768fa8a0991149134de2df.tar.bz2 rails-0fa0107d2d87f751c6768fa8a0991149134de2df.zip |
Take in to account optional arguments when deprecating
Refs: rails/jbuilder#452
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/template/handlers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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. |