エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
PragDave: Premature optimisation in my Rails session code?
For years and years, I've been writing def current_user @current_user ||= (session[:user_id] &&... For years and years, I've been writing def current_user @current_user ||= (session[:user_id] && User.find_by_id(session[:user_id])) end The idea was to look up and store the current user object in an instance variable the frst time the method was called, and then use the value in that variable for subsequent calls in the same request. But now I'm thinking I'll just write this: def current_user



2012/07/19 リンク