エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
restful-authentication の Authentication::ByPassword をコードリーディング - 昔の Ruby On Rails のブログ
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
restful-authentication の Authentication::ByPassword をコードリーディング - 昔の Ruby On Rails のブログ
使い方はこんな感じ User.rb class User < ActiveRecord::Base include Authentication include Authent... 使い方はこんな感じ User.rb class User < ActiveRecord::Base include Authentication include Authentication::ByPassword ... これで以下のような事が出来る。 勝手に validation が追加される(パスワードは6文字以上等) User.password_digest("hoge", "fuga") 等の様にクラスメソッドが追加される @user.authenticated? 等の様にインスタンスメソッドが追加される 3部構成になっている クラスメソッド1つと module が2つです。 module Authentication module ByPassword def self.included(recipient) {} module ModelClassMethods {} mod