1
我正在使用has_secure_token gem,並且希望將標記字符長度縮短爲8.默認情況下爲24。這是鏈接到寶石https://github.com/robertomiranda/has_secure_token
Rails has_secure_token縮短字符長度
此令牌與我的組模型相關聯。我正在瀏覽gem的代碼,並嘗試在groups_helper.rb中執行此操作,但我沒有運氣。關於如何修改令牌長度的想法?提前道歉,如果這是一個簡單的修復,但我在這裏失去了一些東西。謝謝。
module GroupsHelper
def generate_unique_secure_token
SecureRandom.base58(4)
end
end