aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorlocalhostdotdev <localhostdotdev@protonmail.com>2019-04-04 18:59:33 +0200
committerlocalhostdotdev <localhostdotdev@protonmail.com>2019-04-04 19:13:46 +0200
commitb2b2f70f1f81b54b799118e8a4feb601ab480c41 (patch)
treed138e8ba90032379d819d0564e3a86705c713667 /actionview
parentdc45130c44ebe0d8b621eba29332b35ea2840738 (diff)
downloadrails-b2b2f70f1f81b54b799118e8a4feb601ab480c41.tar.gz
rails-b2b2f70f1f81b54b799118e8a4feb601ab480c41.tar.bz2
rails-b2b2f70f1f81b54b799118e8a4feb601ab480c41.zip
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)
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/template/handlers.rb6
1 files changed, 3 insertions, 3 deletions
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