Remove zero-padding from account slug

This shortens URLs in the self-hosted case, where external account ID is
typically a small number.
This commit is contained in:
Kevin McConnell
2026-01-28 11:48:38 +00:00
parent c059e0b216
commit e105ca6fb5
2 changed files with 11 additions and 3 deletions
@@ -44,6 +44,15 @@ class AccountSlugExtractorTest < ActiveSupport::TestCase
assert_nil captured.fetch(:current_account)
end
test "encodes account IDs without zero-padding" do
assert_equal "1", AccountSlug.encode(1)
end
test "decodes both padded and non-padded slugs" do
assert_equal 123, AccountSlug.decode("123")
assert_equal 123, AccountSlug.decode("0000123")
end
private
def call_with_env(path, extra_env = {})
captured = {}