feat: タグ補完から 0 件を除外(#109) (#245)

#109

#109

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #245
This commit was merged in pull request #245.
This commit is contained in:
2026-01-29 22:48:03 +09:00
parent 01646ebcb7
commit 39ec57c142
3 changed files with 20 additions and 2 deletions
@@ -11,4 +11,15 @@ class ApplicationController < ActionController::API
code = request.headers['X-Transfer-Code'] || request.headers['HTTP_X_TRANSFER_CODE']
@current_user = User.find_by(inheritance_code: code)
end
def bool? key, default: false
return default if params[key].nil?
s = params[key].to_s.strip.downcase
if default
!(s.in?(['0', 'false', 'off', 'no']))
else
s.in?(['', '1', 'true', 'on', 'yes'])
end
end
end