16928: Avoid misleading warning when using implicit bool defaults.
authorTom Clegg <tom@tomclegg.ca>
Wed, 7 Oct 2020 17:32:10 +0000 (13:32 -0400)
committerTom Clegg <tom@tomclegg.ca>
Wed, 7 Oct 2020 17:32:10 +0000 (13:32 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

services/api/app/controllers/application_controller.rb

index 62b0ebd2e868559d73479023bbf1becea519b19b..1800e125d27d8e0b89795ed836924762b75ec5d1 100644 (file)
@@ -611,7 +611,7 @@ class ApplicationController < ActionController::Base
         # Make sure params[key] is either true or false -- not a
         # string, not nil, etc.
         if not params.include?(key)
-          params[key] = info[:default]
+          params[key] = info[:default] || false
         elsif [false, 'false', '0', 0].include? params[key]
           params[key] = false
         elsif [true, 'true', '1', 1].include? params[key]