From b2b2f70f1f81b54b799118e8a4feb601ab480c41 Mon Sep 17 00:00:00 2001 From: localhostdotdev Date: Thu, 4 Apr 2019 18:59:33 +0200 Subject: Fix arity warning for template handlers Mainly to help with knowning which template is reponsible for the warning. handler.class # => Class handler.to_s # => Coffee::Rails::TemplateHandler Before: Change: >> Class#call(template) To: >> Class#call(template, source) After: Change: >> Coffee::Rails::TemplateHandler.call(template) To: >> Coffee::Rails::TemplateHandler.call(template, source) --- actionview/lib/action_view/template/handlers.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/template/handlers.rb b/actionview/lib/action_view/template/handlers.rb index ddaac7a100..6450513003 100644 --- a/actionview/lib/action_view/template/handlers.rb +++ b/actionview/lib/action_view/template/handlers.rb @@ -45,12 +45,12 @@ module ActionView #:nodoc: unless params.find_all { |type, _| type == :req || type == :opt }.length >= 2 ActiveSupport::Deprecation.warn <<~eowarn - Single arity template handlers are deprecated. Template handlers must + Single arity template handlers are deprecated. Template handlers must now accept two parameters, the view object and the source for the view object. Change: - >> #{handler.class}#call(#{params.map(&:last).join(", ")}) + >> #{handler}.call(#{params.map(&:last).join(", ")}) To: - >> #{handler.class}#call(#{params.map(&:last).join(", ")}, source) + >> #{handler}.call(#{params.map(&:last).join(", ")}, source) eowarn handler = LegacyHandlerWrapper.new(handler) end -- cgit v1.2.3