Skip to content

Commit

Permalink
Extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Sep 5, 2024
1 parent c938335 commit 16a4d74
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/helpers/api_howto_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16a4d74

Please sign in to comment.