Bug #21169
Updated by Tom Clegg over 1 year ago
As of #20846, testing services/api in Ruby 3 gave the following warnings.
<pre>
/home/tom/arvados/services/api/app/views/user_notifier/account_is_setup.text.erb:5: warning: Passing safe_level with the 2nd argument of ERB.new is de\
precated. Do not use it, and specify other arguments as keyword arguments.
/home/tom/arvados/services/api/app/views/user_notifier/account_is_setup.text.erb:5: warning: Passing trim_mode with the 3rd argument of ERB.new is dep\
recated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
</pre>
However, if we do the obvious thing:
<pre><code class="diff">
diff --git a/services/api/app/views/user_notifier/account_is_setup.text.erb b/services/api/app/views/user_notifier/account_is_setup.text.erb
index 352ee7754e..e6349922fa 100644
--- a/services/api/app/views/user_notifier/account_is_setup.text.erb
+++ b/services/api/app/views/user_notifier/account_is_setup.text.erb
@@ -2,4 +2,4 @@
SPDX-License-Identifier: AGPL-3.0 %>
-<%= ERB.new(Rails.configuration.Users.UserSetupMailText, 0, "-").result(binding) %>
+<%= ERB.new(Rails.configuration.Users.UserSetupMailText, safe_level: 0, trim_mode: "-").result(binding) %>
</code></pre>
The result is:
<pre>
UserNotifierTest#test_account_is_setup = 0.54 s = E
Error:
UserNotifierTest#test_account_is_setup:
ActionView::Template::Error: unknown keyword: :safe_level
app/views/user_notifier/account_is_setup.text.erb:5:in `new'
app/views/user_notifier/account_is_setup.text.erb:5
app/mailers/user_notifier.rb:14:in `account_is_setup'
test/unit/user_notifier_test.rb:36:in `block in <class:UserNotifierTest>'
</pre>
Keeping @trim_mode: "-"@ and removing @safe_mode: 0@ makes the errors and warnings go away, but what are the other implications of removing that?