エントリーの編集
![loading...](https://b.st-hatena.com/f27c0b793148c4c51ce0d5c7a77dd5e10c208478/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Rails Quick Tips - Random Records
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/f27c0b793148c4c51ce0d5c7a77dd5e10c208478/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Rails Quick Tips - Random Records
by Matt Polito on June 4, 2013 Ordering records returned from ActiveRecord in a random manner is ... by Matt Polito on June 4, 2013 Ordering records returned from ActiveRecord in a random manner is on the chopping block today. Scenario: I want to return 5 random users How would we go about solving this? Well maybe a first pass would look something like this? ![Random][header_image] User.all.shuffle[0..4] So on this first pass we are grabbing all User records, shuffling them around, and then grabb