エントリーの編集
 
                エントリーの編集は全ユーザーに共通の機能です。
                    必ずガイドラインを一読の上ご利用ください。
ActiveRecord::SecureToken::ClassMethods
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
 
          - バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
ActiveRecord::SecureToken::ClassMethods
# File activerecord/lib/active_record/secure_token.rb, line 61 def generate_unique_secure_token(l... # File activerecord/lib/active_record/secure_token.rb, line 61 def generate_unique_secure_token(length: MINIMUM_TOKEN_LENGTH) SecureRandom.base58(length) end Example using has_secure_token # Schema: User(token:string, auth_token:string) class User < ActiveRecord::Base has_secure_token has_secure_token :auth_token, length: 36 end user = User.new user.save user.token # => "pX27zsMN2ViQKta1bGfLmVJE"
 
               
             
 
 

