From 16a4d7455c49610c2abb011658e096bed33a4d3f Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Thu, 5 Sep 2024 02:18:49 +0000 Subject: [PATCH] Extract method --- app/helpers/api_howto_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/api_howto_helper.rb b/app/helpers/api_howto_helper.rb index 30ac7c4c9..a25424f69 100644 --- a/app/helpers/api_howto_helper.rb +++ b/app/helpers/api_howto_helper.rb @@ -20,9 +20,14 @@ def htmlify(url) safe_join([first, "?", query]) end + sig { returns(T.nilable(ApiKey)) } + def api_key_object + current_user&.api_keys&.first + end + sig { returns(T.nilable(String)) } def api_key - current_user&.api_keys&.first&.value + api_key_object&.value end sig do